本文整理汇总了Java中com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType类的典型用法代码示例。如果您正苦于以下问题:Java CodeTreeNodeType类的具体用法?Java CodeTreeNodeType怎么用?Java CodeTreeNodeType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CodeTreeNodeType类属于com.blackducksoftware.sdk.protex.project.codetree包,在下文中一共展示了CodeTreeNodeType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStringSearchDiscoveries
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public List<StringSearchDiscovery> getStringSearchDiscoveries(String projectID, String path) {
CodeTreeNode tmpCodeTreeNode = new CodeTreeNode();
tmpCodeTreeNode.setNodeType(CodeTreeNodeType.FILE);
tmpCodeTreeNode.setName(path);
PartialCodeTree fileOnlyTree = new PartialCodeTree();
fileOnlyTree.setParentPath("/");
fileOnlyTree.getNodes().add(tmpCodeTreeNode);
List<StringSearchPatternOriginType> searchOnly = new ArrayList<StringSearchPatternOriginType>(1);
searchOnly.add(StringSearchPatternOriginType.STANDARD);
searchOnly.add(StringSearchPatternOriginType.CUSTOM);
try {
return this.discoveryAPI.getStringSearchDiscoveries(projectID, fileOnlyTree, searchOnly);
} catch (SdkFault e) {
log.error(e.getMessage());
}
return null;
}
示例2: compare
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
@Override
public int compare(CodeTreeNode arg0, CodeTreeNode arg1) {
if(arg0.getNodeType() != arg1.getNodeType()) {
return (arg0.getNodeType() == CodeTreeNodeType.FILE)?1:-1;
} else {
return arg0.getName().compareTo(arg1.getName());
}
}
示例3: treeWalk
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public void treeWalk(String parentPath) throws SdkFault {
log.debug("treeWalk: "+parentPath);
PartialCodeTree thisLevel = mCodeTreeAPI.getCodeTree(mProjectID, parentPath, CodeTreeUtilities.DIRECT_CHILDREN, Boolean.FALSE);
// Deal with all the sub-folders first
for (CodeTreeNode node : thisLevel.getNodes()) {
if ((node.getNodeType() == CodeTreeNodeType.EXPANDED_ARCHIVE) || (node.getNodeType() == CodeTreeNodeType.FOLDER)) {
treeWalk(constructPath(parentPath, node.getName()));
}
}
doWork(thisLevel);
}
示例4: preprocess
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
protected static String preprocess(CodeTreeNode node) {
return (node.getNodeType() != CodeTreeNodeType.FILE ? node.getName() + "/" : node.getName()).replaceAll("([^/]*)/+", "\0$1/");
}
示例5: doWork
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
private void doWork(PartialCodeTree thisLevel) throws SdkFault {
// do the work here
if (thisLevel.getNodes().size() == 0) {
return;
}
PartialCodeTree fileNodes = new PartialCodeTree();
fileNodes.setParentPath(thisLevel.getParentPath());
for (CodeTreeNode node : thisLevel.getNodes()) {
if (node.getNodeType() == CodeTreeNodeType.FILE) {
fileNodes.getNodes().add(node);
}
}
if (fileNodes.getNodes().size() == 0) {
return;
}
List<CodeTreeIdentificationInfo> idInfos = mIdentificationAPI.getEffectiveIdentifications(mProjectID,fileNodes);
for (CodeTreeIdentificationInfo idInfo : idInfos) {
String filePath = constructPath(thisLevel.getParentPath(), idInfo.getName());
for (Identification id : idInfo.getIdentifications()) {
String mComponentID = id.getIdentifiedComponentId();
Component mComponent = mProjectAPI.getComponentById(mProjectID, mComponentID);
if(mComponent == null) continue;
String mComponentName = mComponent.getName();
String fileComment = mCodeTreeAPI.getFileOrFolderComment(mProjectID, filePath);
String fileLicense = "";
LicenseInfo mLicenseInfo = id.getIdentifiedLicenseInfo();
if(mLicenseInfo != null) fileLicense = parseFileLicense(mLicenseInfo.getName());
IdentificationType discoveryType = id.getType();
String mIndetifyURL = mBomAPI.getIdentifyBomUrl(mProjectID,filePath);
log.debug("-- " + filePath + " : " + mIndetifyURL);
identifiedFileList.add(new IdentifiedFilesRow(filePath, mComponentName, fileComment, fileLicense, mProjectName, discoveryType.toString()));
String msg = " "+ identifiedFileList.size() + " files are loaded.";
observer.pushMessage(msg);
log.debug(msg);
}
}
}
示例6: setBase
import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public void setBase() {
/** Common **/
fileOnlyTree.setParentPath("/");
fileOnlyTree.getNodes().add(tmpCodeTreeNode);
tmpCodeTreeNode.setNodeType(CodeTreeNodeType.FILE);
}