/** * 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; }
/** * 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"; }
public String getSettingsFilename() { return Const.getKettleDirectory() + Const.FILE_SEPARATOR + ".languageChoice"; } }
private String getKettlePropertiesFilename() { return Const.getKettleDirectory() + "/" + Const.KETTLE_PROPERTIES; }
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; }
private String getKettleDirPath() { return new File( Const.getKettleDirectory() ).getPath(); } }
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; }
/** * Returns the full path to the Kettle repositories XML file. * * @return The Kettle repositories file. */ public static String getKettleUserRepositoriesFile() { return getKettleDirectory() + FILE_SEPARATOR + getKettleLocalRepositoriesFile(); }
/** * 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 } }
/** * 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 ); }
public String getFilename() { return Const.getKettleDirectory() + Const.FILE_SEPARATOR + "db.cache-" + BuildVersion.getInstance().getVersion(); }
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 ); }
try { registry = new OrderedFileRegistry(); ( (OrderedFileRegistry) registry ).setFilePath( org.pentaho.di.core.Const.getKettleDirectory() + File.separator + "registry.xml" ); factory.setMetadataRegistry( registry );
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; }