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

void org::jlhafrontend::JLHAFrontEnd::genListArray ( String  filename,
Vector  data 
) [inline, package]

generate a list of files by the given file/directory

Parameters:
filename the given file/directory
data return value, the list of the files

Definition at line 405 of file JLHAFrontEnd.java.

References addFileSeparator(), genListArray(), and mylogger.

                                                   {
      File fl=null;
      File[] childs=null;
      int i;
      String dirname=null;

        try {
          fl = new File(filename);
      } catch (Exception e) {
          mylogger.info("open file error");
          return;
      }

      try {
          if (fl.isFile()) {
            data.add(filename);
          } else if (fl.isDirectory()) {
            dirname = addFileSeparator(filename);
            data.add(dirname);
            childs = fl.listFiles();
            for (i=0 ; i<childs.length ; i++) {
                genListArray(dirname+childs[i].getName(),data);
            }
          } else {
            mylogger.severe("fl is unknown");
          }
      } catch (SecurityException e) {
          mylogger.severe("operation error "+e.toString());
      }
    }


Generated by  Doxygen 1.6.0   Back to index