org.pentaho.di.core.Const.isWindows()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中org.pentaho.di.core.Const.isWindows()方法的一些代码示例,展示了Const.isWindows()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.isWindows()方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:isWindows

Const.isWindows介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * 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 "'";
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return the usage description
 *
 */
public String getUsageDescription() {
 String optionStart = "  -";
 String optionDelim = " = ";
 if ( Const.isWindows() ) {
  optionStart = "  /";
  optionDelim = " : ";
 }
 return optionStart + Const.rightPad( option, 14 ) + optionDelim + description;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

@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();
}

代码示例来源:origin: pentaho/pentaho-kettle

if ( isWindows() ) {

代码示例来源:origin: pentaho/pentaho-kettle

try {
 boolean isWindows = Const.isWindows();
 if ( !isWindows ) {
  fileContent = replaceWinEOL( fileContent );

代码示例来源:origin: pentaho/pentaho-kettle

if ( !System.getProperty( "file.separator" ).equals( "/" ) && !Const.isWindows() ) {
 file = file.replace( "/", System.getProperty( "file.separator" ) );

代码示例来源:origin: pentaho/pentaho-kettle

if ( !System.getProperty( "file.separator" ).equals( "/" ) && !Const.isWindows() ) {
 file = file.replace( "/", System.getProperty( "file.separator" ) );

代码示例来源:origin: pentaho/pentaho-kettle

@BeforeClass
public static void setupBeforeClass() throws KettleException {
 if ( Const.isWindows() ) {
  wasEncoding = System.getProperty( "file.encoding" );
  fiddleWithDefaultCharset( "utf8" );
 }
 KettleClientEnvironment.init();
}

代码示例来源:origin: pentaho/pentaho-kettle

String lignePing = "";
String CmdPing = "ping ";
if ( Const.isWindows() ) {
 CmdPing += hostname + " " + Windows_CHAR + " " + nrpackets;
} else {

代码示例来源:origin: pentaho/pentaho-kettle

if ( Const.isWindows() ) {
 p = Runtime.getRuntime().exec( command );
} else {

代码示例来源:origin: pentaho/pentaho-kettle

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 );

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

toolTipText = BaseMessages.getString( PKG, "Spoon.TabJob.Tooltip", tabText );
if ( Const.isWindows() && !Utils.isEmpty( meta.getFilename() ) ) {
 toolTipText += Const.CR + Const.CR + meta.getFilename();

代码示例来源:origin: pentaho/pentaho-kettle

if ( Const.isWindows() || Const.isLinux() ) {
 extra += 15;

代码示例来源:origin: pentaho/pentaho-kettle

if ( !Const.isWindows() ) {
 logBasic( BaseMessages.getString( PKG, "MySQLBulkLoader.Message.OPENFIFO",  data.fifoFilename ) );
 OpenFifo openFifo = new OpenFifo( data.fifoFilename, 1000 );

代码示例来源:origin: pentaho/pentaho-kettle

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 {

代码示例来源:origin: pentaho/big-data-plugin

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" ) ) );
  }
 }
}

代码示例来源:origin: pentaho/big-data-plugin

if ( !Const.isWindows() ) {
 addColumnTooltip( wOutputFields.getTable(), 1 );

相关文章