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


Java RepositoryFileTreeDto.getFile方法代码示例

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


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

示例1: checkForExistingFile

import org.pentaho.platform.repository2.unified.webservices.RepositoryFileTreeDto; //导入方法依赖的package包/类
/**
 * find a matching file/path combination by going back to server fileTree and matching name
 * @param path
 * @param name
 * @return true if file exists on path
 */
public boolean checkForExistingFile(String path, String name) {
  boolean ans = false;
  if (path == null || name == null) {
    Log.error("path ["+path+"] and name ["+name+"] cannot be null");
    return false;
  }    
  try {
    RepositoryFileTreeDto tree = fetchRepositoryFileTree(path, -1, null , false);
    if (tree != null && tree.getFile() != null && !tree.getChildren().isEmpty()) {
      for(RepositoryFileTreeDto file :tree.getChildren()){
        if (!file.getFile().isFolder()) {
          if (file.getFile().getName().equals(name)) {             
            ans = true;
            break;
          }
        }        
      }
    }

  } catch (Exception e) {
    Log.error(e.getMessage(),e);
  }
  return ans;
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:31,代码来源:ModelServerPublish.java

示例2: createSolutionTree

import org.pentaho.platform.repository2.unified.webservices.RepositoryFileTreeDto; //导入方法依赖的package包/类
/**
 * 
 * @param model
 * @param folderTreeDepth
 * @throws PublishException
 */
public void createSolutionTree(final XulDialogPublishModel dialogModel, final int folderTreeDepth) throws PublishException {
  try {

    RepositoryFileTreeDto tree = fetchRepositoryFileTree(null,folderTreeDepth, null, null);
    if (tree != null && tree.getFile() != null) {
      SolutionObject root = new SolutionObject();
      root.add(new SolutionObject(tree, folderTreeDepth));
      dialogModel.setSolutions(root);
    }

  } catch (Exception e) {
    throw new PublishException("Error building solution document", e);
  }

}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:22,代码来源:ModelServerPublish.java

示例3: processPurgeForTree

import org.pentaho.platform.repository2.unified.webservices.RepositoryFileTreeDto; //导入方法依赖的package包/类
private void processPurgeForTree( RepositoryFileTreeDto tree, PurgeUtilitySpecification purgeSpecification ) {

    for ( RepositoryFileTreeDto child : tree.getChildren() ) {
      try {
        if ( !child.getChildren().isEmpty() ) {
          processPurgeForTree( child, purgeSpecification );
        }
        RepositoryFileDto file = child.getFile();
        getLogger().setCurrentFilePath( file.getPath() );
        if ( file.isVersioned() ) {
          if ( purgeSpecification.isPurgeFiles() ) {
            getLogger().info( "Purge File" );
            keepNumberOfVersions( file.getId(), 1 ); // the latest version will be removed with deleteFileWithPermanentFlag
            getRepoWs().deleteFileWithPermanentFlag( file.getId(), true, "purge utility" );
          } else if ( purgeSpecification.isPurgeRevisions() ) {
            getLogger().info( "Purging Revisions" );
            deleteAllVersions( file.getId() );
          } else {
            if ( purgeSpecification.getBeforeDate() != null ) {
              getLogger().info( "Checking/purging by Revision date" );
              deleteVersionsBeforeDate( file.getId(), purgeSpecification.getBeforeDate() );
            }
            if ( purgeSpecification.getVersionCount() >= 0 ) {
              getLogger().info( "Checking/purging by number of Revisions" );
              keepNumberOfVersions( file.getId(), purgeSpecification.getVersionCount() );
            }
          }
        }
      } catch ( Exception e ) {
        getLogger().error( e );
      }
    }
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:34,代码来源:UnifiedRepositoryPurgeService.java


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