예제 #1
0
 private void process_args(String[] args) {
   Vector source_names = new Vector();
   for (int i = 0; i < args.length; i++) {
     String arg = args[i];
     if (isFlag(arg)) process_flag(arg);
     else source_names.addElement(arg);
   }
   _destination_name = (String) source_names.lastElement();
   int n_sources = source_names.size() - 1;
   if (n_sources == 0)
     throw new NakshException(
         "The arguments to cp must include a "
             + "destination file or directory, and at "
             + "least one source file or directory.");
   _sources = new Vector(n_sources);
   for (int i = 0; i < n_sources; i++) {
     String source_name = (String) source_names.elementAt(i);
     _sources.addElement(File.create(source_name));
   }
 }