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


Java RepositoryDirectoryInterface.getObjectId方法代码示例

本文整理汇总了Java中org.pentaho.di.repository.RepositoryDirectoryInterface.getObjectId方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryDirectoryInterface.getObjectId方法的具体用法?Java RepositoryDirectoryInterface.getObjectId怎么用?Java RepositoryDirectoryInterface.getObjectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.repository.RepositoryDirectoryInterface的用法示例。


在下文中一共展示了RepositoryDirectoryInterface.getObjectId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renameRepositoryDirectory

import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
public ObjectId renameRepositoryDirectory(ObjectId id, RepositoryDirectoryInterface newParentDir, String newName)
    throws KettleException {
  ObjectId parentId = null;
  if (newParentDir != null) {
    parentId = newParentDir.getObjectId();
  }

  try {
    renameDirectory(id, parentId, newName);
    return id; // doesn't change in this specific case.
  } catch (Exception e) {
    throw new KettleException("Unable to rename the specified repository directory [" + id + "]", e);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:15,代码来源:KettleDatabaseRepositoryDirectoryDelegate.java

示例2: renameRepositoryDirectory

import org.pentaho.di.repository.RepositoryDirectoryInterface; //导入方法依赖的package包/类
public ObjectId renameRepositoryDirectory(ObjectId id, RepositoryDirectoryInterface newParentDir, String newName) throws KettleException {
  if(newParentDir != null || newName != null) {
 	  try {
       // In case of a root object, the ID is the same as the relative filename...
 	    RepositoryDirectoryInterface tree = loadRepositoryDirectoryTree();
 	    RepositoryDirectoryInterface dir = tree.findDirectory(id);
 	    
 	    if(dir == null) {
 	      throw new KettleException("Could not find folder [" + id + "]");
 	    }
 	    
 	    // If newName is null, keep the current name
 	    newName = (newName != null) ? newName : dir.getName();
 
       FileObject folder = KettleVFS.getFileObject(dir.getPath());
       
       String newFolderName = null;
       
       if(newParentDir != null) {
         FileObject newParentFolder = KettleVFS.getFileObject(newParentDir.getPath());
         
         newFolderName = newParentFolder.toString() + "/" + newName;
       } else {
         newFolderName = folder.getParent().toString() + "/" + newName;
       }
       
       FileObject newFolder = KettleVFS.getFileObject(newFolderName);
       folder.moveTo(newFolder);
       
       return new StringObjectId(dir.getObjectId());
     }
     catch (Exception e) {
       throw new KettleException("Unable to rename directory folder to ["+id+"]");
     }
  }
  return(id);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:KettleFileRepository.java


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