當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。