本文整理匯總了Java中org.pentaho.di.repository.Repository.findDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Java Repository.findDirectory方法的具體用法?Java Repository.findDirectory怎麽用?Java Repository.findDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.repository.Repository
的用法示例。
在下文中一共展示了Repository.findDirectory方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isDirectoryExist
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
/**
* isDirectoryExist:判斷指定的job目錄是否存在. <br/>
* @author jingma
* @param repository
* @param directoryName
* @return
* @since JDK 1.6
*/
public static boolean isDirectoryExist(Repository repository, String directoryName) {
try {
RepositoryDirectoryInterface dir = repository.findDirectory(directoryName);
if(dir==null){
return false;
}else{
return true;
}
} catch (KettleException e) {
log.error("判斷job目錄是否存在失敗!",e);
}
return false;
}
示例2: Trans
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
public Trans(VariableSpace parentVariableSpace, Repository rep, String name, String dirname, String filename) throws KettleException
{
this();
try
{
if (rep!=null)
{
RepositoryDirectoryInterface repdir = rep.findDirectory(dirname);
if (repdir!=null)
{
this.transMeta = rep.loadTransformation(name, repdir, null, false, null); // reads last version
}
else
{
throw new KettleException(BaseMessages.getString(PKG, "Trans.Exception.UnableToLoadTransformation",name,dirname)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
else
{
transMeta = new TransMeta(filename, false);
}
this.log = new LogChannel(this);
transMeta.initializeVariablesFrom(parentVariableSpace);
initializeVariablesFrom(parentVariableSpace);
transMeta.copyParametersFrom(this);
transMeta.activateParameters();
this.setDefaultLogCommitSize();
}
catch(KettleException e)
{
throw new KettleException(BaseMessages.getString(PKG, "Trans.Exception.UnableToOpenTransformation",name), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例3: getTransMeta
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
public TransMeta getTransMeta(Repository rep, VariableSpace space) throws KettleException {
try {
TransMeta transMeta = null;
switch (specificationMethod) {
case FILENAME:
String filename = space.environmentSubstitute(getFilename());
logBasic("Loading transformation from XML file [" + filename + "]");
transMeta = new TransMeta(filename, null, true, this);
break;
case REPOSITORY_BY_NAME:
String transname = space.environmentSubstitute(getTransname());
String realDirectory = space.environmentSubstitute(getDirectory());
logBasic(BaseMessages.getString(PKG, "JobTrans.Log.LoadingTransRepDirec", transname, realDirectory));
if (rep != null) {
//
// It only makes sense to try to load from the repository when the
// repository is also filled in.
//
// It reads last the last revision from the repository.
//
RepositoryDirectoryInterface repositoryDirectory = rep.findDirectory(realDirectory);
transMeta = rep.loadTransformation(transname, repositoryDirectory, null, true, null);
} else {
throw new KettleException(BaseMessages.getString(PKG, "JobTrans.Exception.NoRepDefined"));
}
break;
case REPOSITORY_BY_REFERENCE:
if (rep != null) {
// Load the last revision
//
transMeta = rep.loadTransformation(transObjectId, null);
}
break;
default:
throw new KettleException("The specified object location specification method '" + specificationMethod + "' is not yet supported in this job entry.");
}
if (transMeta != null) {
// copy parent variables to this loaded variable space.
//
transMeta.copyVariablesFrom(this);
// Set the arguments...
//
transMeta.setArguments(arguments);
}
return transMeta;
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "JobTrans.Exception.MetaDataLoad"), e);
}
}
示例4: loadJob
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
/**
* loadTrans:加載作業. <br/>
* @author jingma
* @param jobname 作業名稱
* @param directory 作業路徑
* @param repository 資源庫
* @return 作業元數據
* @throws KettleException
* @since JDK 1.6
*/
public static JobMeta loadJob(String jobname, String directory,Repository repository) throws KettleException {
RepositoryDirectoryInterface dir = repository.findDirectory(directory);
return repository.loadJob(jobname,dir,null, null);
}
示例5: loadTrans
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
/**
* loadTrans:加載轉換. <br/>
* @author jingma
* @param transname 轉換名稱
* @param directory 轉換路徑
* @param repository 資源庫
* @return 轉換元數據
* @throws KettleException
* @since JDK 1.6
*/
public static TransMeta loadTrans(String transname, String directory,Repository repository) throws KettleException {
RepositoryDirectoryInterface dir = repository.findDirectory(directory);
return repository.loadTransformation( transname, dir, null, true, null);
}