Package org.jayasoft.woj.tools.dl

Examples of org.jayasoft.woj.tools.dl.Category


                    path = path.substring(0, path.length() - classFilePath.length() - 1);
                    if (path.endsWith("!")) {
                        path = path.substring(0, path.length() - 1);
//                        path = path + "/";
                    }
                    Category source = Category.getCategory("source");
                    for (CategoryItem item : desc.getItems(source)) {
                        if (item.parseValue(path).equals(item.getAttribute("path"))) {
                            return;
                        }
                    }
                    desc.getItems(source).add(source.newItem(rev, path));
                }
            }
        }
       
    }
View Full Code Here


    private void searchLicense(Revision rev, RevisionDescriptor desc, String path, String fileName) {
        if (StringUtils.countMatches(path, "!") >= 2) {
            // do not go too deep for license detection
            return;
        }
        Category cat = Category.getCategory(Category.LICENSE);       
        if (desc.getItems(cat).isEmpty() && matchAny(fileName, LICENSE_PATTERNS)) {
            addItem(rev, desc, path, "license");
        }
    }
View Full Code Here

            addItem(rev, desc, path, "license");
        }
    }
   
    private void searchArtifactsOrDependencies(Revision rev, RevisionDescriptor desc, File root, String path, String fileName) {
        Category sourceCat = Category.getCategory(Category.SOURCE);

        if (fileName.endsWith(".jar")) {
            if (fileName.equals("src.jar") || path.indexOf(".jar!/") != -1) {
                addJarNotAnalyzed(path);
                return;
View Full Code Here

    private int findSourceForThisClassFile(Revision rev, RevisionDescriptor desc, File root, String classFilePath) {
        // Get the java path
        String javaFilePath = classFilePath.substring(0, classFilePath.length() - 5) + "java";
        // For each item in source category, look for a java file corresponding to fileName.
        int result = NO_SOURCE;
        Category sourceCat = Category.getCategory(Category.SOURCE);
        for (CategoryItem catItem : desc.getItems(sourceCat)) {
         result = NO_SOURCE_FOUND;
          String path = catItem.getFormattedAttribute("path");
          if (DLExplorer.fileExist(root, path + javaFilePath)) {
              return SOURCE_FOUND;
View Full Code Here

        }
        return false;
    }

    private void addItem(Revision rev, RevisionDescriptor desc, String path, String catName) {
        Category cat = Category.getCategory(catName);
        desc.getItems(cat).add(cat.newItem(rev, path));
    }
View Full Code Here

   
  private Set<String> getArtifactCkecksumList(RevisionDescriptor rd, ChecksumProvider provider) {
    Set categories = rd.getCategories();
        Set<String> result = new HashSet<String>();
        for (Iterator iter = categories.iterator(); iter.hasNext();) {
            Category cat = (Category)iter.next();
            if (Category.ARTIFACT.equals(cat.getName())) {
                Collection items = rd.getItems(cat);
                for (Iterator iterator = items.iterator(); iterator.hasNext();) {
                    CategoryItem item = (CategoryItem)iterator.next();
          try {
            InputStream is = FSHelper.openInputStream(_explorer.getRevisionDir(item.getRevision()).toURL().toString(), item.getPath());
View Full Code Here

   
    private List<String> getPathsFromCategory(RevisionDescriptor rd, String category) {
        Set categories = rd.getCategories();
        List<String> result = new ArrayList<String>();
        for (Iterator iter = categories.iterator(); iter.hasNext();) {
            Category cat = (Category)iter.next();
            if (category.equals(cat.getName())) {
                Collection items = rd.getItems(cat);
                for (Iterator iterator = items.iterator(); iterator.hasNext();) {
                    CategoryItem item = (CategoryItem)iterator.next();
                    result.add(_explorer.getRevisionDir(item.getRevision()) + "/" + item.getPath());
                }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.tools.dl.Category

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.