@Override public String massageFieldName( final String fieldName ) { // Replace all spaces and hyphens (-) with underscores (_) String massagedFieldName = fieldName; massagedFieldName = Const.replace( massagedFieldName, " ", "_" ); massagedFieldName = Const.replace( massagedFieldName, "-", "_" ); return massagedFieldName; }
private String fixFileName( String filename ) { filename = filename.replace( '/', '_' ); // do something with illegal file name chars if ( !( "/".equals( Const.FILE_SEPARATOR ) ) ) { filename = Const.replace( filename, Const.FILE_SEPARATOR, "_" ); } return filename; }
private String calcDirectoryName( RepositoryDirectoryInterface dir ) { StringBuilder directory = new StringBuilder(); String baseDir = repositoryMeta.getBaseDirectory(); baseDir = Const.replace( baseDir, "\\", "/" ); directory.append( baseDir ); if ( !baseDir.endsWith( "/" ) ) { directory.append( "/" ); } if ( dir != null ) { String path = calcRelativeElementDirectory( dir ); if ( path.startsWith( "/" ) ) { directory.append( path.substring( 1 ) ); } else { directory.append( path ); } if ( !path.endsWith( "/" ) ) { directory.append( "/" ); } } return directory.toString(); }
public static String getFilename( FileObject fileObject ) { FileName fileName = fileObject.getName(); String root = fileName.getRootURI(); if ( !root.startsWith( "file:" ) ) { return fileName.getURI(); } if ( root.endsWith( ":/" ) ) { root = root.substring( 8, 10 ); } else { root = root.substring( 7, root.length() - 1 ); } String fileString = root + fileName.getPath(); if ( !"/".equals( Const.FILE_SEPARATOR ) ) { fileString = Const.replace( fileString, "/", Const.FILE_SEPARATOR ); } return fileString; }
public static String constructUrl( VariableSpace space, String hostname, String port, String webAppName, String serviceAndArguments, boolean isSecure ) throws UnsupportedEncodingException { String realHostname = space.environmentSubstitute( hostname ); if ( !StringUtils.isEmpty( webAppName ) ) { serviceAndArguments = "/" + space.environmentSubstitute( webAppName ) + serviceAndArguments; } String protocol = isSecure ? PROTOCOL_SECURE : PROTOCOL_UNSECURE; String retval = protocol + "://" + realHostname + getPortSpecification( space, port ) + serviceAndArguments; retval = Const.replace( retval, " ", "%20" ); return retval; }
public static String getFilename( FileObject fileObject ) { FileName fileName = fileObject.getName(); String root = fileName.getRootURI(); if ( !root.startsWith( "file:" ) ) { return fileName.getURI(); // nothing we can do about non-normal files. } if ( root.startsWith( "file:////" ) ) { return fileName.getURI(); // we'll see 4 forward slashes for a windows/smb network share } if ( root.endsWith( ":/" ) ) { // Windows root = root.substring( 8, 10 ); } else { // *nix & OSX root = ""; } String fileString = root + fileName.getPath(); if ( !"/".equals( Const.FILE_SEPARATOR ) ) { fileString = Const.replace( fileString, "/", Const.FILE_SEPARATOR ); } return fileString; }
public String constructUrl( String serviceAndArguments ) throws UnsupportedEncodingException { String realHostname = null; String proxyHostname = null; lock.readLock().lock(); try { realHostname = environmentSubstitute( hostname ); proxyHostname = environmentSubstitute( getProxyHostname() ); } finally { lock.readLock().unlock(); } if ( !Utils.isEmpty( proxyHostname ) && realHostname.equals( "localhost" ) ) { realHostname = "127.0.0.1"; } if ( !StringUtils.isBlank( webAppName ) ) { serviceAndArguments = "/" + environmentSubstitute( getWebAppName() ) + serviceAndArguments; } String result = ( isSslMode() ? HTTPS : HTTP ) + "://" + realHostname + getPortSpecification() + serviceAndArguments; result = Const.replace( result, " ", "%20" ); return result; }
filename = Const.replace( transMeta.getFilename(), " ", "_" ).toLowerCase() + ".kar";
public Value replace( String repl, String with ) { if ( isNull() ) { return this; } if ( getString() == null ) { setNull(); } else { setValue( Const.replace( getString(), repl, with ) ); } return this; }
if ( string != null ) { if ( meta.getFieldFormatType()[i] == MySQLBulkLoaderMeta.FIELD_FORMAT_TYPE_STRING_ESCAPE ) { string = Const.replace( string, meta.getEscapeChar(), meta.getEscapeChar() + meta.getEscapeChar() ); string = Const.replace( string, meta.getEnclosure(), meta.getEscapeChar() + meta.getEnclosure() );
buttons[ i ].setToolTipText( Const.replace( buttons[ i ].getText(), "&", "" ) );
private void getInfo() { stepErrorMeta.setTargetStep( StepMeta.findStep( targetSteps, wTargetStep.getText() ) ); stepErrorMeta.setEnabled( wEnabled.getSelection() ); stepErrorMeta.setNrErrorsValuename( wNrErrors.getText() ); stepErrorMeta.setErrorDescriptionsValuename( wErrDesc.getText() ); stepErrorMeta.setErrorFieldsValuename( wErrFields.getText() ); stepErrorMeta.setErrorCodesValuename( wErrCodes.getText() ); stepErrorMeta.setMaxErrors( wMaxErrors.getText() ); stepErrorMeta.setMaxPercentErrors( Const.replace( wMaxPct.getText(), "%", "" ) ); stepErrorMeta.setMinPercentRows( wMinPctRows.getText() ); } }
FieldTerminatedby = FieldTerminatedby + "TERMINATED BY '" + Const.replace( getRealSeparator(), "'", "''" ) + "'"; FieldTerminatedby + " ENCLOSED BY '" + Const.replace( getRealEnclosed(), "'", "''" ) + "'"; FieldTerminatedby + " ESCAPED BY '" + Const.replace( getRealEscaped(), "'", "''" ) + "'"; LineTerminatedby = LineTerminatedby + "STARTING BY '" + Const.replace( getRealLinestarted(), "'", "''" ) + "'"; LineTerminatedby = LineTerminatedby + " TERMINATED BY '" + Const.replace( getRealLineterminated(), "'", "''" ) + "'";