本文整理汇总了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;
}
示例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);
}
}
示例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 );
}
}
}