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

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

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

Const.getEnvironmentVariable介绍

[英]Retrieves the content of an environment variable
[中]检索环境变量的内容

代码示例

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

/**
  * Whether we should use GSSAPI when authenticating or not.
  */
 private String getPreferredAuthentications() {
  String param = Const.getEnvironmentVariable( ENV_PARAM_USERAUTH_GSSAPI, null );
  return Boolean.valueOf( param ) ? PREFERRED_AUTH_WITH_GSSAPI : PREFERRED_AUTH_DEFAULT;
 }
}

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

private CarteStatusCache() {
 period = Integer.parseInt( Const.getEnvironmentVariable( "CARTE_CLEAR_PERIOD", "1" ) );
 timeUnit = TimeUnit.valueOf( Const.getEnvironmentVariable( "CARTE_CLEAR_TIMEUNIT", "DAYS" ) );
 removeService.scheduleAtFixedRate( this::clear, 1, 1, TimeUnit.DAYS );
}

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

protected boolean loadAltProps() {
 // check the -D switch... something like -Dorg.pentaho.di.laf.alt="somefile.properties"
 String altFile = Const.getEnvironmentVariable( "org.pentaho.di.laf.alt", null );
 if ( altFile != null ) {
  return loadProps( altFile );
 }
 return false;
}

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

public static Object hourOfDay( ValueMetaInterface metaA, Object dataA ) throws KettleValueException {
 if ( dataA == null ) {
  return null;
 }
 Calendar calendar = Calendar.getInstance();
 calendar.setTime( metaA.getDate( dataA ) );
 Boolean oldDateCalculation = Boolean.parseBoolean(
  Const.getEnvironmentVariable( Const.KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION, "false" ) );
 if ( !oldDateCalculation ) {
  calendar.setTimeZone( metaA.getDateFormatTimeZone() );
 }
 return new Long( calendar.get( Calendar.HOUR_OF_DAY ) );
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  ArrayList<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  ArrayList<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings( ComboVar var ) {
  // Encoding of the text file:
  String encoding = Const.NVL( var.getText(), Const.getEnvironmentVariable( "file.encoding", "UTF-8" ) );
  var.removeAll();
  ArrayList<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   var.add( charSet.displayName() );
  }

  // Now select the default!
  int idx = Const.indexOfString( encoding, var.getItems() );
  if ( idx >= 0 ) {
   var.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  java.util.List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( Charset charSet : values ) {
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
  // Encoding of the text file:
  if ( !gotEncodings ) {
   gotEncodings = true;

   wEncoding.removeAll();
   java.util.List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
   for ( Charset charSet : values ) {
    wEncoding.add( charSet.displayName() );
   }

   // Now select the default!
   String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
   int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
   if ( idx >= 0 ) {
    wEncoding.select( idx );
   }
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<>( Charset.availableCharsets().values() );
  for ( Charset charSet : values ) {
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( Charset charSet : values ) {
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  }
 }
}

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

private void setEncodings() {
 // Encoding of the text file:
 if ( !gotEncodings ) {
  gotEncodings = true;
  wEncoding.removeAll();
  List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   wEncoding.add( charSet.displayName() );
  }
  // Now select the default!
  String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
  int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
  if ( idx >= 0 ) {
   wEncoding.select( idx );
  } else {
   wEncoding.select( Const.indexOfString( "UTF-8", wEncoding.getItems() ) );
  }
 }
}

相关文章