Logo Search packages:      
Sourcecode: jlha-utils version File versions  Download package

void org::jlhafrontend::JLHAFrontEnd::verboseList ( Opts  useropts,
String  archiveFilename,
String[]  filesFilename 
) [inline]

execute verbose list command

Parameters:
useropts Options input by users
archiveFilename the filename of the archive file
filesFilename the array of filenames to be processed

Definition at line 1256 of file JLHAFrontEnd.java.

References org::jlhafrontend::ListFormatter::getCRC(), org::jlhafrontend::ListFormatter::getMETHOD(), org::jlhafrontend::ListFormatter::getPACKED(), org::jlhafrontend::ListFormatter::getPERMSSN(), org::jlhafrontend::Opts::getQuiet(), org::jlhafrontend::ListFormatter::getRATIO(), org::jlhafrontend::ListFormatter::getSIZE(), org::jlhafrontend::ListFormatter::getSTAMP(), org::jlhafrontend::ListFormatter::getUIDGID(), org::jlhafrontend::Opts::getVerbose(), isInArray(), listCore(), and org::jlhafrontend::ListFormatter::toField().

Referenced by start().

                                                                                           {
      LhaHeader[] data;
      int i,N=0,quiet=0;
      ListFormatter lf=new ListFormatter();
      long size_sum=0,pack_sum=0,ratio_avg=-1;
      boolean verbose=false;

      verbose=useropts.getVerbose();
      quiet=useropts.getQuiet();
      data = listCore(useropts,archiveFilename,filesFilename);
      if (quiet==0) {
          System.out.print(" PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP");
          if (!verbose) { 
            System.out.print("          NAME"); 
          }
          System.out.println("");
          System.out.print("---------- ----------- ------- ------- ------ ---------- ------------");
          if (!verbose) {
            System.out.print(" -------------");
          }
          System.out.println("");
      }
      if (data==null) {
          System.err.println("LHa: Warning: Checksum error (LHarc file?)");
          System.err.println("LHa: Fatal error: Unkonwn header (lha file?)");
          return;
      }
      for (i=0 ; i<data.length ; i++) {

          if (filesFilename != null && !isInArray(data[i].getPath(),filesFilename)) {
            continue;
          }
          lf = new ListFormatter(data[i]);
          size_sum += data[i].getOriginalSize();
          pack_sum += data[i].getCompressedSize();
          if (verbose) {
            System.out.println(data[i].getPath());
          }
          System.out.print(lf.getPERMSSN());
          System.out.print(" ");
          System.out.print(lf.getUIDGID());
          System.out.print(" ");
          System.out.print(lf.getPACKED());
          System.out.print(" ");
          System.out.print(lf.getSIZE());
          System.out.print(" ");
          System.out.print(lf.getRATIO());
          System.out.print(" ");
          System.out.print(lf.getMETHOD());
          System.out.print(" ");
          System.out.print(lf.getCRC());
          System.out.print(" ");
          System.out.print(lf.getSTAMP());
          System.out.print(" ");
          if (!verbose) {
            System.out.print(data[i].getPath());
          } else {
            System.out.print("[2]");
          }
          System.out.println("");
          N++;
      }
      if (size_sum>0) {
          ratio_avg = pack_sum*1000/size_sum;
      } else {
          ratio_avg = -1;
      }
      if (quiet==0) {
          System.out.print("---------- ----------- ------- ------- ------ ---------- ------------");
          if (!verbose) {
            System.out.print(" -------------");
          }
          System.out.println("");
          System.out.print(" Total    ");
          System.out.print(" ");
          System.out.print(lf.toField(Integer.toString(N),5,false));
          if (N==1) {
            System.out.print(" file ");
          } else {
            System.out.print(" files");
          }
          System.out.print(" ");
          System.out.print(lf.toField(Long.toString(pack_sum),7,false));
          System.out.print(" ");
          System.out.print(lf.toField(Long.toString(size_sum),7,false));
          System.out.print(" ");
          if (ratio_avg >= 0) {
            System.out.print(lf.toField(Long.toString(ratio_avg/10)+"."+Long.toString(ratio_avg%10)+"%",6,false));
          } else {
            System.out.print("******");
          }
          System.out.print(" ");
          System.out.print("          ");
          System.out.print(" ");
          System.out.print(ListFormatter.genFileDate(archiveFilename));
          System.out.println("");
      }
    }


Generated by  Doxygen 1.6.0   Back to index