Exemple #1
0
  private void share(ArrayList<String> params) throws IOException {
    printer.println("All complete files: ");
    // ArrayList<Hash> al = new
    // ArrayList<Hash>(core.getFileManager().getFileDatabase().getAllHashes());
    // for (Hash h : al) {
    //    FileDescriptor fd = core.getFileManager().getFileDatabase().getFd(h);
    // //    printer.println("  " + fd);
    //   }
    printer.println("");

    printer.println("Incomplete files in cache: ");
    for (Hash h : core.getFileManager().getCache().rootHashes()) {
      BlockFile bf = core.getFileManager().getCache().getBlockFile(h);
      printer.println("  " + bf);
    }
    printer.println("");

    printer.println("Incomplete files in downloads: ");
    for (Hash h : core.getFileManager().getDownloadStorage().rootHashes()) {
      BlockFile bf = core.getFileManager().getDownloadStorage().getBlockFile(h);
      printer.println("  " + bf);
    }
    printer.println("");

    printer.println(
        "Sharing "
            + TextUtils.formatByteSize(core.getShareManager().getFileDatabase().getShareSize())
            + " in "
            + core.getShareManager().getFileDatabase().getNumberOfShares()
            + " files.");
    printer.println("");
  }
Exemple #2
0
 private void dir(String sharebase, String path) {
   printer.println("Directory listing for " + path + ": ");
   sharebase = TextUtils.makeSurePathIsMultiplatform(sharebase);
   ShareBase b = core.getFileManager().getShareManager().getBaseByPath(sharebase);
   if (b == null) {
     printer.println("Could not find share base for " + sharebase);
     return;
   }
   printer.println("Found share base: " + b);
   /*  for (String s : core.getFileManager().getFileDatabase().getDirectoryListing(b, path)) {
   printer.println(s);
   }*/
 }
Exemple #3
0
 private void sharebases() {
   printer.println("Sharebases: ");
   for (ShareBase b : core.getFileManager().getShareManager().shareBases()) {
     printer.println("  " + b);
   }
 }
Exemple #4
0
 private void filedatabase() throws IOException {
   core.getFileManager().getFileDatabase().printStats(printer);
 }