/** * Determine the quoting character depending on the OS. Often used for shell calls, gives back " for Windows systems * otherwise ' * * @return quoting character */ public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } }
/** * @return the usage description * */ public String getUsageDescription() { String optionStart = " -"; String optionDelim = " = "; if ( Const.isWindows() ) { optionStart = " /"; optionDelim = " : "; } return optionStart + Const.rightPad( option, 14 ) + optionDelim + description; }
public static String getExplanation( String zipFilename, String launchFile, ResourceExportInterface resourceExportInterface ) { String commandString = ""; if ( Const.isWindows() ) { if ( resourceExportInterface instanceof TransMeta ) { commandString += "Pan.bat /file:\""; } else { commandString += "Kitchen.bat /file:\""; } } else { if ( resourceExportInterface instanceof TransMeta ) { commandString += "sh pan.sh -file='"; } else { commandString += "sh kitchen.sh -file='"; } } commandString += launchFile; if ( Const.isWindows() ) { commandString += "\""; } else { commandString += "'"; } String message = BaseMessages.getString( PKG, "ResourceUtil.ExportResourcesExplanation", zipFilename, commandString, launchFile, Const.CR ); return message; } }
@Override public String getTestObject() { String lineTerminator = Const.isWindows() ? "\n" : Const.CR; StringBuilder text = new StringBuilder(); int lines = new Random().nextInt( 10 ) + 1; for ( int i = 0; i < lines; i++ ) { text.append( super.getTestObject() ); if ( i + 1 < lines ) { text.append( lineTerminator ); } } return text.toString(); }
if ( isWindows() ) {
try { boolean isWindows = Const.isWindows(); if ( !isWindows ) { fileContent = replaceWinEOL( fileContent );
if ( !System.getProperty( "file.separator" ).equals( "/" ) && !Const.isWindows() ) { file = file.replace( "/", System.getProperty( "file.separator" ) );
if ( !System.getProperty( "file.separator" ).equals( "/" ) && !Const.isWindows() ) { file = file.replace( "/", System.getProperty( "file.separator" ) );
@BeforeClass public static void setupBeforeClass() throws KettleException { if ( Const.isWindows() ) { wasEncoding = System.getProperty( "file.encoding" ); fiddleWithDefaultCharset( "utf8" ); } KettleClientEnvironment.init(); }
String lignePing = ""; String CmdPing = "ping "; if ( Const.isWindows() ) { CmdPing += hostname + " " + Windows_CHAR + " " + nrpackets; } else {
if ( Const.isWindows() ) { p = Runtime.getRuntime().exec( command ); } else {
scope.put( "exit_status", scope, exit_status ); scope.put( "nr", scope, nr ); scope.put( "is_windows", scope, Boolean.valueOf( Const.isWindows() ) ); scope.put( "_entry_", scope, this );
public JobEntryInterface open() { Shell parent = getParent(); display = parent.getDisplay(); shell = new Shell( parent, props.getJobsDialogStyle() ); props.setLook( shell ); JobDialog.setShellImage( shell, jobEntry ); backupChanged = jobEntry.hasChanged(); createElements(); // Detect [X] or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); getData(); setActive(); BaseStepDialog.setSize( shell ); int width = 750; int height = Const.isWindows() ? 730 : 720; shell.setSize( width, height ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return jobEntry; }
public JobEntryInterface open() { Shell parent = getParent(); display = parent.getDisplay(); shell = new Shell( parent, props.getJobsDialogStyle() ); props.setLook( shell ); JobDialog.setShellImage( shell, jobEntry ); backupChanged = jobEntry.hasChanged(); createElements(); // Detect [X] or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); getData(); setActive(); BaseStepDialog.setSize( shell ); int width = 750; int height = Const.isWindows() ? 730 : 718; shell.setSize( width, height ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return jobEntry; }
toolTipText = BaseMessages.getString( PKG, "Spoon.TabJob.Tooltip", tabText ); if ( Const.isWindows() && !Utils.isEmpty( meta.getFilename() ) ) { toolTipText += Const.CR + Const.CR + meta.getFilename();
if ( Const.isWindows() || Const.isLinux() ) { extra += 15;
if ( !Const.isWindows() ) { logBasic( BaseMessages.getString( PKG, "MySQLBulkLoader.Message.OPENFIFO", data.fifoFilename ) ); OpenFifo openFifo = new OpenFifo( data.fifoFilename, 1000 );
if ( jobMeta != null ) { if ( jobMeta.getName() != null ) { if ( Const.isWindows() ) { cmdFile = "kitchen " if ( Const.isWindows() ) { cmdFile = "pan " if ( jobMeta != null ) { if ( jobMeta.getFilename() != null ) { if ( Const.isWindows() ) { cmdFile = "kitchen " + "/file:\"" + jobMeta.getFilename() + "\"" + " /level:Basic"; } else { if ( Const.isWindows() ) { cmdFile = "pan " + "/file:\"" + transMeta.getFilename() + "\"" + " /level:Basic"; } else {
private void setDialogSize() { XulSpoonSettingsManager settingsManager = XulSpoonSettingsManager.getInstance(); XulDialog dialog = controller.getDialog(); if ( Const.isWindows() ) { settingsManager.storeSetting( controller.getDialogElementId() + ".Width", String.valueOf( dialog.getWidth() ) ); settingsManager.storeSetting( controller.getDialogElementId() + ".Height", String.valueOf( dialog.getHeight() ) ); } else { settingsManager.storeSetting( controller.getDialogElementId() + ".Width", String.valueOf( dialog.getAttributeValue( "linuxWidth" ) ) ); settingsManager.storeSetting( controller.getDialogElementId() + ".Height", String.valueOf( dialog.getAttributeValue( "linuxHeight" ) ) ); } } }
if ( !Const.isWindows() ) { addColumnTooltip( wOutputFields.getTable(), 1 );