Logo Search packages:      
Sourcecode: jmk version File versions  Download package

static String [] edu::neu::ccs::jmk::FileOperator::glob ( String[]  args  )  throws CommandFailedException [inline, static, package]

This method expands an array of localized file names that may contain wild cards to an array of file names without wild cards. Wild cards must conform to the rules given above.

Definition at line 135 of file FileOperator.java.

References glob().

  {
    for (int i = 0; i < args.length; i++) {
      if (args[i].indexOf(wildCard) >= 0) { // If wild card
      Vector v = new Vector();
      for (int j = 0; j < i; j++) // Add previous strings
        v.addElement(args[j]);
      addStrings(v, glob(args[i])); // Add this arg
      for (int j = i + 1; j < args.length; j++) // Add remaining args
        if (args[j].indexOf(wildCard) >= 0)
          addStrings(v, glob(args[j]));
        else
          v.addElement(args[j]);
      String[] result = new String[v.size()];
      v.copyInto(result);
      return result;          // Wild cards found
      }
    }
    return args;        // No wild cards found
  }


Generated by  Doxygen 1.6.0   Back to index