当前位置: 首页>>代码示例>>Java>>正文


Java Repository.findDirectory方法代码示例

本文整理汇总了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;
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:22,代码来源:KettleUtils.java

示例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$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:36,代码来源:Trans.java

示例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);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:55,代码来源:JobEntryTrans.java

示例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);
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:15,代码来源:KettleUtils.java

示例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);
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:15,代码来源:KettleUtils.java


注:本文中的org.pentaho.di.repository.Repository.findDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。