本文整理汇总了Java中org.pentaho.di.repository.RepositoryDirectoryInterface.getPath方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryDirectoryInterface.getPath方法的具体用法?Java RepositoryDirectoryInterface.getPath怎么用?Java RepositoryDirectoryInterface.getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.repository.RepositoryDirectoryInterface
的用法示例。
在下文中一共展示了RepositoryDirectoryInterface.getPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeDirs
import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
/**
* <br/>
* @author jingma
* @param directoryName
* @return
* @throws KettleException
*/
public static RepositoryDirectoryInterface makeDirs(String directoryName) throws KettleException {
if(StringUtil.isNotBlank(directoryName)){
String parentDirectory = "";
String[] dirArr = directoryName.replace("\\", "/").split("/");
for(String dirStr:dirArr){
try {
if(StringUtil.isNotBlank(dirStr)){
RepositoryDirectoryInterface p = getOrMakeDirectory(parentDirectory, dirStr);
parentDirectory = p.getPath();
}
} catch (Exception e) {
log.error("创建目录失败:"+directoryName+","+parentDirectory+","+dirStr, e);
}
}
return getOrMakeDirectory(parentDirectory,null);
}else{
return null;
}
}
示例2: getDirectory
import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
/**
* 获取指定的job目录. <br/>
* @author jingma
* @param dirId
* @return
* @throws KettleException
* @since JDK 1.6
*/
public static String getDirectory(ObjectId dirId) throws KettleException {
RepositoryDirectoryInterface dir = repository.findDirectory(dirId);
if(dir==null){
return null;
}else{
return dir.getPath();
}
}
示例3: calcRelativeElementDirectory
import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
public String calcRelativeElementDirectory(RepositoryDirectoryInterface dir) {
if (dir!=null) {
return dir.getPath();
} else {
return "/";
}
}
示例4: createDirectory
import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
public void createDirectory(TreeItem ti, RepositoryDirectoryInterface repdir)
{
EnterStringDialog esd = new EnterStringDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AskName.Default"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AskName.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AskName.Message")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String newdir = esd.open();
if (newdir!=null)
{
RepositoryDirectoryInterface rd = new RepositoryDirectory(repdir, newdir);
String path[] = rd.getPathArray();
RepositoryDirectoryInterface exists = directoryTree.findDirectory( path );
if (exists==null)
{
try {
rep.saveRepositoryDirectory(rd);
} catch(Exception exception) {
new ErrorDialog(shell,
BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.UnexpectedError.Message1")+newdir+BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.UnexpectedError.Message2")+repdir.getPath()+"]", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.UnexpectedError.Title"), //$NON-NLS-1$
exception
);
}
}
else
{
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AlreadyExists.Message1")+newdir+BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AlreadyExists.Message2")+repdir.getPath()+BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AlreadyExists.Message3")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Directory.Create.AlreadyExists.Title")); //$NON-NLS-1$
mb.open();
}
}
}