Ejemplo n.º 1
0
 private void checkLibraries() {
   if (line.hasOption(LIBRARIES)) {
     Set<String> merged = JavadocOfflineSearch.listLibraries();
     List<String> configList = JavadocOfflineSearch.getConigLIbraries();
     List<String> cacheList = JavadocOfflineSearch.getCacheLIbraries();
     if (merged.isEmpty()) {
       System.out.println("No library found. You did not run -index yet");
     } else {
       // first verify files
       System.out.println("    Files sanity:");
       for (String library : merged) {
         verify(library);
       }
       System.out.println(
           "* - prefixed library is default (see config file of "
               + LibraryManager.defaultLibDefName
               + ")");
       // second only invalid libraries
       System.out.println("    Possibly corrupted libraries:");
       for (String library : merged) {
         if (configList.contains(library) && cacheList.contains(library)) {
           // prefixLIbrary(library);
           // System.out.println(library);
         } else if (!configList.contains(library) && cacheList.contains(library)) {
           prefixLIbrary(library);
           System.out.println("WARNING only in cache folder - " + library);
         } else if (configList.contains(library) && !cacheList.contains(library)) {
           prefixLIbrary(library);
           System.out.println("WARNING only in config folder - " + library);
         } else {
           prefixLIbrary(library);
           System.out.println("Error, library from different planet - " + library);
         }
       }
       // last only valid libraries
       System.out.println("    Libraries:");
       for (String library : merged) {
         if (configList.contains(library) && cacheList.contains(library)) {
           prefixLIbrary(library);
           System.out.println(library);
         } else if (!configList.contains(library) && cacheList.contains(library)) {
           // prefixLIbrary(library);
           // System.out.println("WARNING only in cache folder - " + library);
         } else if (configList.contains(library) && !cacheList.contains(library)) {
           // prefixLIbrary(library);
           // System.out.println("WARNING only in config folder - " + library);
         } else {
           // prefixLIbrary(library);
           // System.out.println("Error, library from different planet - " + library);
         }
       }
     }
     System.exit(0);
   }
 }
Ejemplo n.º 2
0
 private void checkLibrary() {
   // here we know that it is not index/server/firefox
   Set<String> q = JavadocOfflineSearch.listLibraries();
   if (!q.contains(getLibrary())) {
     System.out.println(
         "When you wont to use library for reading, it must exists. "
             + getLibrary()
             + " Does not.");
     if (q.size() > 0) {
       List<String> l = Vocabulary.didYouMean(5, q, getLibrary());
       System.out.println("Could you mean: ");
       System.out.print(" ");
       for (String l1 : l) {
         System.out.print(" " + l1);
       }
       System.out.println("");
     }
     System.exit(15);
   }
 }