Package org.jayasoft.woj.tools

Examples of org.jayasoft.woj.tools.WojToolsSettings


        out.println("<p>Copyright Jayasoft 2005-2006 - All rights reserved</p>");
        out.println("</html></body>");
    }
   
    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);

        String root = settings.getDLDir().getPath();
        String outputFileName = settings.getLogsDir().getPath()+ "/dl-report.html";
        DLExplorer explorer = new DLExplorer(root);

        DLReporter reporter = new DLReporter(explorer);
        long start = System.currentTimeMillis();
        reporter.scanAll();
View Full Code Here


            e1.printStackTrace();
        }
    }

    public static void main(String[] args) throws IOException {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
       
        try {
            ClientServerServicesProvider ssp = ClientServerServicesProvider.get(settings.getServer());
            Authentification auth;
            auth = ssp.getAuthentificationService().authenticate(settings.getUserName(), settings.getPassword(), "");
           
            if (auth instanceof AuthSuccessfull) {
                ModuleManagementService mms = ssp.getModuleManagementService();
                AddModuleToWOJ batch = new AddModuleToWOJ(mms);
                batch.processDirectory(settings.getModulesDir().getPath());
                System.out.println("job done");
            } else {
                System.out.println("Authentication failed !");
            }
        } catch (Exception e) {
View Full Code Here

import fr.jayasoft.commons.io.IOHelper;

public class ReportUploadErrors {
    public static void main(String[] args) throws IOException {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);

        long errorCount = 0;
        File root = settings.getModulesDir();
        File[] orgs = root.listFiles();
        for (File org : orgs) {
            File[] modules = org.listFiles();
            for (File mod : modules) {
                File[] zips = mod.listFiles();
View Full Code Here

    }
    throw new IllegalStateException("Unable to remove host info for url:"+u+" Url to download must be in mirrors definition");
  }

  public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
        File d = settings.getDLDir();
        File specs = new File(settings.getDescriptorsDir(), "sourceforge.list");
       
        List<String> problems =new ArrayList<String>();
        SFDownloader dl = new SFDownloader(d);
       
        // uncomment to use directly prdownload listing
View Full Code Here

        return false;
    }

    private final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss");
    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);

        String localHostName = getLocalHostName();
        System.out.println("scanning " + settings.getDLDir()+ " on "+localHostName+" -- revision ("+DATE_FORMAT.format(new Date(REVISION_DATE))+")");
       
        DLExplorer explorer = new DLExplorer(settings.getDLDir().getAbsolutePath());
        DLAnalyzer analyzer = new DLAnalyzer(explorer);
        DLReporter reporter = new DLReporter(explorer);
       
        int analysed = 0;
        long total = 0;
        long start = System.currentTimeMillis();
        for (Organisation org : explorer.getOrganisations()) {
            System.out.println("scanning "+org.getName());
            for (Module module : explorer.getModules(org)) {
                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();
            }
        }
        long duration = System.currentTimeMillis() - start;
        System.out.println("\nbatch analyse finished: "+total+" revisions found, "+analysed+" analysed in "+duration+"ms");

        String outputFileName = settings.getLogsDir().getPath()+"/dl-analyze-report.html";
        System.out.println("\nreporting to "+outputFileName);
        File outputFile = new File(outputFileName);
        if (outputFile.getParentFile() != null) {
            outputFile.getParentFile().mkdirs();
        }
View Full Code Here

import org.jayasoft.woj.tools.dl.Revision;
import org.xml.sax.helpers.DefaultHandler;

public class DLCleaner {
    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
        String root = settings.getDLDir().getAbsolutePath();
        System.out.println("cleaning: " + root);

        DLExplorer explorer = new DLExplorer(root);
       
        long start = System.currentTimeMillis();
View Full Code Here

    private File getTempSourcesDir(Revision revision) {
        return new File(System.getProperty("java.io.tmpdir")+"/"+revision.getModule().getOrganisation().getName()+"-"+revision.getModule().getName()+"-"+revision.getName());
    }
   
    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
        String root = settings.getDLDir().getPath();
        System.out.println("scanning: " + root);

        DLExplorer explorer = new DLExplorer(root);
        DLJavadocGenerator generator = new DLJavadocGenerator(explorer);
       
View Full Code Here

        return new ModuleInfoImpl(rev.getModule().getOrganisation().getName(), rev.getModule().getName(), rev.getName(), Visibility.PUBLIC, false, false);
    }
   
    public static void main(String[] args) {
        try {
            WojToolsSettings settings = WojToolsSettings.buildInstance(args);
           
            DLExplorer explorer = new DLExplorer(settings.getDLDir().getPath());

            settings.getLogsDir().mkdirs();
            File trace = new File(settings.getLogsDir(), "moduleBuilder.log");
            File errors = new File(settings.getLogsDir(), "moduleBuilder.err");
            System.setErr(new PrintStream(errors));
            System.setOut(new PrintStream(trace));
           
            System.out.println("\n\n\nBEGINNING MODULE BUILDER "+new Date()+" - "+settings.getServer());
            System.err.println("\n\n\nBEGINNING MODULE BUILDER "+new Date()+" - "+settings.getServer());
           
            ClientServerServicesProvider ssp = ClientServerServicesProvider.get(settings.getServer());
      Authentification auth;
            auth = ssp.getAuthentificationService().authenticate(settings.getUserName(), settings.getPassword(), "");
     
      if (auth instanceof AuthSuccessfull) {
        ModuleManagementService mms = ssp.getModuleManagementService();
        FromDLModuleBuilder builder = new FromDLModuleBuilder(explorer, mms, settings.getModulesDir());
        for (Iterator iter = explorer.getAllRevisions().iterator(); iter.hasNext();) {
          Revision rev = (Revision)iter.next();
          builder.build(rev);
        }
        System.out.println("\nFINISHED");
View Full Code Here

 
  public static void main(String[] args) throws Exception {
        Options options = WojToolsSettings.getOptions(getOptions());

        WojToolsSettings settings = WojToolsSettings.buildInstance(options, args);
        File d = settings.getDLDir();
        File descriptorsDir = settings.getDescriptorsDir();
        System.out.println("Descriptors directory :"+descriptorsDir);
        CommandLineParser parser = new GnuParser();
        String descFileName = "";
        try {
            // parse the command line arguments
View Full Code Here

        }
    }

    public static void main(String[] args) {
        try {
            WojToolsSettings settings = WojToolsSettings.buildInstance(args);

            ClientServerServicesProvider ssp = ClientServerServicesProvider.get(settings.getServer());
            Authentification auth;
            auth = ssp.getAuthentificationService().authenticate(settings.getUserName(), settings.getPassword(), "");
           
            if (auth instanceof AuthSuccessfull) {
                ModuleManagementService mms = ssp.getModuleManagementService();
                RemoveModuleFromWOJBatch batch = new RemoveModuleFromWOJBatch(mms);
                batch.process(new DLExplorer(settings.getDLDir().getPath()));
                System.out.println("job done");
            } else {
                System.out.println("Authentication failed !");
            }
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.tools.WojToolsSettings

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.