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

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

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

Const.getKettleDirectory介绍

[英]Determines the Kettle absolute directory in the user's home directory.
[中]确定用户主目录中的壶穴绝对目录。

代码示例

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

/**
 * Determines the location of the shared objects file
 *
 * @return the name of the shared objects file
 */
public static String getSharedObjectsFile() {
 return getKettleDirectory() + FILE_SEPARATOR + SHARED_DATA_FILE;
}

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

/**
 * Returns the path to the Kettle Carte password file in the home directory:
 * <p>
 * $KETTLE_HOME/.kettle/kettle.pwd<br>
 *
 * @return The Carte password file in the home directory.
 */
public static String getKettleCartePasswordFile() {
 return getKettleDirectory() + FILE_SEPARATOR + "kettle.pwd";
}

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

public String getSettingsFilename() {
  return Const.getKettleDirectory() + Const.FILE_SEPARATOR + ".languageChoice";
 }
}

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

private String getKettlePropertiesFilename() {
 return Const.getKettleDirectory() + "/" + Const.KETTLE_PROPERTIES;
}

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

public String getFilename() {
 String filename = "";
 String directory = Const.getKettleDirectory();
 switch ( type ) {
  case TYPE_PROPERTIES_SPOON:
  case TYPE_PROPERTIES_PAN:
   filename = directory + Const.FILE_SEPARATOR + ".spoonrc";
   break;
  case TYPE_PROPERTIES_CHEF:
  case TYPE_PROPERTIES_KITCHEN:
   filename = directory + Const.FILE_SEPARATOR + ".chefrc";
   break;
  case TYPE_PROPERTIES_MENU:
   filename = directory + Const.FILE_SEPARATOR + ".menurc";
   break;
  case TYPE_PROPERTIES_PLATE:
   filename = directory + Const.FILE_SEPARATOR + ".platerc";
   break;
  default:
   break;
 }
 return filename;
}

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

private String getKettleDirPath() {
  return new File( Const.getKettleDirectory() ).getPath();
 }
}

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

public String getLicenseFilename() {
 String directory = Const.getKettleDirectory();
 String filename = directory + Const.FILE_SEPARATOR + ".licence";
 // Try to create the directory...
 File dir = new File( directory );
 if ( !dir.exists() ) {
  try {
   dir.mkdirs();
  } catch ( Exception e ) {
   // ignore - should likely report failure to create directory
  }
 }
 return filename;
}

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

/**
 * Returns the full path to the Kettle repositories XML file.
 *
 * @return The Kettle repositories file.
 */
public static String getKettleUserRepositoriesFile() {
 return getKettleDirectory() + FILE_SEPARATOR + getKettleLocalRepositoriesFile();
}

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

/**
 * Creates the kettle home area, which is a directory containing a default kettle.properties file
 */
public static void createKettleHome() {
 // Try to create the directory...
 //
 String directory = Const.getKettleDirectory();
 File dir = new File( directory );
 try {
  dir.mkdirs();
  // Also create a file called kettle.properties
  //
  createDefaultKettleProperties( directory );
 } catch ( Exception e ) {
  // ignore - should likely propagate the error
 }
}

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

/**
 * Returns the properties from the users kettle home directory.
 *
 * @param fileName
 *          the relative name of the properties file in the users kettle directory.
 * @return the map of properties.
 */
public static Properties readProperties( final String fileName ) throws KettleException {
 if ( !new File( fileName ).exists() ) {
  return readPropertiesByFullPath( Const.getKettleDirectory() + Const.FILE_SEPARATOR + fileName );
 }
 return readPropertiesByFullPath( fileName );
}

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

public String getFilename() {
 return Const.getKettleDirectory()
  + Const.FILE_SEPARATOR + "db.cache-" + BuildVersion.getInstance().getVersion();
}

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

private void applyLog4jConfiguration() {
 LogLog.setQuietMode( true );
 LogManager.resetConfiguration();
 LogLog.setQuietMode( false );
 /**
  * On DOMConfigurator.doConfigure() no exception is ever propagated; it's caught and its stacktrace is written to System.err.
  *
  * @link https://github.com/apache/log4j/blob/v1_2_17_rc3/src/main/java/org/apache/log4j/xml/DOMConfigurator.java#L877-L878
  *
  * When the kettle5-log4j-plugin is dropped under ~/.kettle/plugins ( which is also a valid location for classic pdi plugins )
  * we get a System.err 'FileNotFoundException' stacktrace, as this is attempting to fetch the log4j.xml under a (default path) of
  * data-integration/plugins/kettle5-log4j-plugin; but in this scenario ( again, a valid one ), kettle5-log4j-plugin is under ~/.kettle/plugins
  *
  * With the inability to catch any exception ( as none is ever propagated ), the option left is to infer the starting path of this plugin's jar;
  * - If it starts with Const.getKettleDirectory(): then we know it to have been dropped in ~/.kettle/plugins ( a.k.a. Const.getKettleDirectory() )
  * - Otherwise: fallback to default/standard location, which is under <pdi-install-dir>/</>data-integration/plugins
  */
 final String log4jPath = getPluginPath().startsWith( getKettleDirPath() )
   ? ( Const.getKettleDirectory() + File.separator + PLUGIN_PROPERTIES_FILE ) : getConfigurationFileName();
 DOMConfigurator.configure( log4jPath );
}

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

try {
 registry = new OrderedFileRegistry();
 ( (OrderedFileRegistry) registry ).setFilePath( org.pentaho.di.core.Const.getKettleDirectory()
  + File.separator + "registry.xml" );
 factory.setMetadataRegistry( registry );

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

public boolean open() {
 try {
  KettleXulLoader theLoader = new KettleXulLoader();
  theLoader.setSettingsManager( XulSpoonSettingsManager.getInstance() );
  theLoader.setSettingsManager( new DefaultSettingsManager( new File( Const.getKettleDirectory()
   + Const.FILE_SEPARATOR + "xulSettings.properties" ) ) );
  theLoader.setOuterContext( this.shell );
  this.container = theLoader.loadXul( XUL, new XulDatabaseExplorerResourceBundle() );
  XulDialog theExplorerDialog =
   (XulDialog) this.container.getDocumentRoot().getElementById( "databaseExplorerDialog" );
  SpoonPluginManager.getInstance().applyPluginsForContainer( "database_dialog", container );
  this.controller =
   new XulDatabaseExplorerController(
    this.shell, this.databaseMeta, this.databases, look );
  this.container.addEventHandler( this.controller );
  this.runner = new SwtXulRunner();
  this.runner.addContainer( this.container );
  this.runner.initialize();
  this.controller.setSelectedSchemaAndTable( schemaName, selectedTable );
  // show dialog if connection is success only.
  if ( controller.getActionStatus() == UiPostActionStatus.OK ) {
   theExplorerDialog.show();
  }
 } catch ( Exception e ) {
  LogChannel.GENERAL.logError( "Error exploring database", e );
 }
 return this.controller.getSelectedTable() != null;
}

相关文章

微信公众号

最新文章

更多