Package org.jayasoft.woj.tools.dl

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


      _tested++;
        File desc = _explorer.getRevisionDescriptorFile(rev);
        if (!desc.exists()) {
           _missing.add(rev);
        } else {
            RevisionDescriptor rd = _explorer.getDescriptor(rev);
            if (!rd.isVerified()) {
                checkMissingCategories(rd, CATEGORIES_CHECKING_MISSING);
            }
        }
    }
View Full Code Here


        });
  }
 
    protected void updateStatus() {
        if (getRevisionDescriptorPanel() != null) {
            RevisionDescriptor rd = getRevisionDescriptorPanel().getDescriptor();
            if (rd != null) {
                _status.setSelectedItem(rd.getStatus());
            }
        }
    }
View Full Code Here

    }

    public RevisionDescriptor analyze(Revision rev) {
        long start = System.currentTimeMillis();
        File root = _dlexplorer.getRevisionDir(rev);
        RevisionDescriptor desc = new RevisionDescriptor(rev, _dlexplorer.getRevisionDescriptorFile(rev), Category.CATEGORIES);
        Collection<String> jars = new ArrayList<String>();
        HashMap<String, Integer> packages = new HashMap<String, Integer>();
        analyze(rev, desc, root, "", jars, packages);
       
//        Collection modulePacks =
       
        analyzeArtifactsAndDependencies(jars, rev, desc, root, "");
        desc.setStatus("generated");
//        System.out.println("analyse of "+rev+" took "+(System.currentTimeMillis() - start)+"ms");
        return desc;
    }
View Full Code Here

                System.out.println("\thandling module : " + module.getName());
                System.out.print("\t"+module.getName());
                for (Revision rev: explorer.getRevisions(module)) {
                        System.out.print(" "+rev.getName());
                        File desc = explorer.getRevisionDescriptorFile(rev);
                        RevisionDescriptor previousRd = null;
                        File previousFile = null;
                        if (desc.exists()) {
                            RevisionDescriptor rd = explorer.getDescriptor(rev);
                            long time = rd.getStatusTime();
                            if ("generated".equals(rd.getStatus()) && time  < REVISION_DATE) {
                                previousFile = new File(explorer.getRevisionDir(rev), "woj-crudemod-"+time+".xml");
                                IOHelper.move(desc, previousFile);
                                System.out.print("[DISCARD]");
                                try {
                                    previousRd = new RevisionDescriptor(rev, previousFile, Category.CATEGORIES);
                                    previousRd.readFile();
                                } catch (Exception ex) {
                                    previousRd = null;
                                }
                            }
                        }
                        if (!desc.exists()) {
                            File lock = new File(explorer.getRevisionDir(rev), ".analyze.lock");
                            if (lock.exists()) {
                               
                                String locking = "unknown";
                                try {
                                    locking = IOHelper.readEntirely(lock);
                                } catch (Exception ex) {
                                }
                                System.out.print("[LOCKED-"+locking+"]");
                                continue;
                            }
                            try {
                                IOHelper.writeFile(lock, localHostName);
                            } catch (Exception ex) {
                                System.out.print("[LOCKED--"+ex.getMessage()+"]");
                                continue;
                            }
                            try {
                                RevisionDescriptor rd = analyzer.analyze(rev);
                                rd.save();
                                System.out.print("[ANALYZED]");
                               
                                if (previousRd != null && previousRd.getAllItems().equals(rd.getAllItems())) {
                                    // new analyze lead to same content: we show same last modified timestamp
                                    rd.setLastModified(previousRd.getLastModified());
                                    previousFile.delete();
                                    System.out.print("[SAME]");
                                }
                               
                                reporter.scan(rev);
                                analysed++;
                            } finally {
                                IOHelper.delete(lock);
                            }
                        } else {
                            RevisionDescriptor rd = explorer.getDescriptor(rev);
                            System.out.print("[EXIST-"+rd.getStatus()+"-"+DATE_FORMAT.format(new Date(rd.getStatusTime()))+"]");                       
                        }
                        total++;
                }
                System.out.println();
            }
View Full Code Here

    }

    public boolean analyze(Revision rev) throws IOException {
        File desc = _dlexplorer.getRevisionDescriptorFile(rev);
        if (desc.exists()) {
            RevisionDescriptor rd = _dlexplorer.getDescriptor(rev);
            if (!rd.getItems(SOURCES).isEmpty() && rd.getItems(JAVADOCS).isEmpty()) {
                genJavadoc(rd);
                return true;
            }
        }
        return false;
View Full Code Here

    super("Save");
    _frame = frame;
  }

  public void actionPerformed(ActionEvent e) {
    RevisionDescriptor rd  = _frame.getSelectedRd();
    if (rd != null) {
        rd.save();
    }
  }
View Full Code Here

   
  public File build(Revision rev) {
        long start = System.currentTimeMillis();
    try {
        System.out.print(rev.getFullName());
      RevisionDescriptor rd = _explorer.getDescriptor(rev);
            boolean replace = false;
            File moduleZipFile = new File(getDestinationDir(), rev.getModule().getOrganisation().getName()+"/"+rev.getModule().getName()+"/"+rev.getName()+".zip");
            if (moduleZipFile.exists()) {
                if (moduleZipFile.lastModified() >= rd.getLastModified()) {
                    System.out.println(" - MODULE ALREADY GENERATED");
                    return moduleZipFile;
                } else {
                    System.out.print(" - DISCARDING OLD VERSION");
                    moduleZipFile.delete();
View Full Code Here

TOP

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

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.