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

void org::jlhafrontend::JLHAFrontEnd::createSwitcher ( Opts  useropts,
LhaOutputStream  lio,
String  filename 
) [inline]

compress a directory or a file into a LhaOutputStream

Parameters:
useropts Options input by users
lio the LhaOutputStream for an archive file
filename the filename

Definition at line 1520 of file JLHAFrontEnd.java.

References createDirectory(), createFile(), and mylogger.

Referenced by add(), create(), createDirectory(), and update().

                                                                                   {
      File fl=null;
      try {
          fl = new File(filename);
      } catch (Exception e) {
          mylogger.severe("new File error: "+e.toString());
          return;
      }

      try {
          if (!fl.exists()) {
            System.err.println("LHa: Cannot access \""+filename+"\", ignored.");
            return;
          }
      } catch (SecurityException e) {
          System.err.println("LHa: Cannot access \""+filename+"\", ignored.");
          return;
      }

      try {
          if (fl.isFile()) {
            createFile(useropts,lio, filename);
          } else if (fl.isDirectory()) {
            createDirectory(useropts,lio, filename);
          } else {
            System.err.println("LHa: Cannot access \""+filename+"\", ignored.");
          }
      } catch (SecurityException e) {
          System.err.println("LHa: Cannot access \""+filename+"\", ignored.");
      }
    }


Generated by  Doxygen 1.6.0   Back to index