예제 #1
0
 void reportheaderinfo() {
   if (JFCMainClient.getbDEBUG()) {
     debugoutput("");
     debugoutput("NO-DOWNLOAD mode active (ndl on)");
     debugoutput("all HTTP header fields:");
     for (int i = 0; i < this.response.getAllHeaders().length; i++) {
       debugoutput(
           this.response
               .getAllHeaders()[i]
               .getName()
               .concat("=")
               .concat(this.response.getAllHeaders()[i].getValue()));
     }
     debugoutput(
         "filename would be: "
             .concat(this.getTitle())
             .concat(".")
             .concat(
                 this.response
                     .getFirstHeader("Content-Type")
                     .getValue()
                     .replaceFirst("video/", "")
                     .replaceAll("x-", ""))); // title contains just filename, no path
   } else {
     Long iFileSize = Long.parseLong(this.response.getFirstHeader("Content-Length").getValue());
     output("");
     output("NO-DOWNLOAD active (ndl on)");
     output("some HTTP header fields:");
     output("content-type: ".concat(this.response.getFirstHeader("Content-Type").getValue()));
     output(
         "content-length: "
             .concat(iFileSize.toString())
             .concat(" Bytes")
             .concat(" ~ ")
             .concat(Long.toString((iFileSize / 1024)).concat(" KiB"))
             .concat(" ~ ")
             .concat(Long.toString((iFileSize / 1024 / 1024)).concat(" MiB")));
     if (JFCMainClient.getbNODOWNLOAD())
       output(
           (JFCMainClient.isgerman() ? "Dateiname würde sein: " : "filename would be: ")
               .concat(
                   this.getTitle()
                       .concat(".")
                       .concat(
                           this.response
                               .getFirstHeader("Content-Type")
                               .getValue()
                               .replaceFirst("video/", "")
                               .replaceAll("x-", "")))); // title contains just filename, no path
   }
   this.sVideoURL = null;
 } // reportheaderinfo()
예제 #2
0
 synchronized void debugoutput(String s) {
   if (!JFCMainClient.getbDEBUG()) return;
   // sometimes this happens:  Exception in thread "Thread-2" java.lang.Error: Interrupted attempt
   // to aquire write lock (on quit only)
   try {
     JFCMainClient.addTextToConsole("#DEBUG ".concat(this.getMyName()).concat(" ").concat(s));
   } catch (Exception e) {
     try {
       Thread.sleep(50);
     } catch (InterruptedException e1) {
     }
     try {
       JFCMainClient.addTextToConsole("#DEBUG ".concat(this.getMyName()).concat(" ").concat(s));
     } catch (Exception e2) {
     }
   }
 } // debugoutput
예제 #3
0
 void output(String s) {
   if (JFCMainClient.getbDEBUG()) return;
   JFCMainClient.addTextToConsole("#info - ".concat(s));
 } // output