/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(List regularExpressions, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpressions), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(List regularExpressions, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpressions), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(List regularExpressions, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpressions), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(String regularExpression, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpression), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(String regularExpression, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpression), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilteredDataEntryWriter that delegates to either of * the two given writers, depending on the given list of filters. */ public NameFilteredDataEntryWriter(String regularExpression, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter) { this(new ListParser(new FileNameParser()).parse(regularExpression), acceptedDataEntryWriter, rejectedDataEntryWriter); }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(String regularExpression, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpression)), acceptedDataEntryReader, rejectedDataEntryReader); }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(String regularExpression, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpression)), acceptedDataEntryReader, rejectedDataEntryReader); }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(String regularExpression, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpression)), acceptedDataEntryReader, rejectedDataEntryReader); }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(String regularExpression, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpression)), acceptedDataEntryReader, rejectedDataEntryReader); }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(List regularExpressions, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpressions)), acceptedDataEntryReader, rejectedDataEntryReader); } }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(List regularExpressions, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpressions)), acceptedDataEntryReader, rejectedDataEntryReader); } }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(List regularExpressions, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpressions)), acceptedDataEntryReader, rejectedDataEntryReader); } }
/** * Creates a new NameFilter that delegates to either of the two given * readers, depending on the given list of filters. */ public NameFilter(List regularExpressions, DataEntryReader acceptedDataEntryReader, DataEntryReader rejectedDataEntryReader) { super(new DataEntryNameFilter(new ListParser(new FileNameParser()).parse(regularExpressions)), acceptedDataEntryReader, rejectedDataEntryReader); } }
/** * A main method for testing file name matching. */ public static void main(String[] args) { try { System.out.println("Regular expression ["+args[0]+"]"); FileNameParser parser = new FileNameParser(); StringMatcher matcher = parser.parse(args[0]); for (int index = 1; index < args.length; index++) { String string = args[index]; System.out.print("String ["+string+"]"); System.out.println(" -> match = "+matcher.matches(args[index])); } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing file name matching. */ public static void main(String[] args) { try { System.out.println("Regular expression ["+args[0]+"]"); FileNameParser parser = new FileNameParser(); StringMatcher matcher = parser.parse(args[0]); for (int index = 1; index < args.length; index++) { String string = args[index]; System.out.print("String ["+string+"]"); System.out.println(" -> match = "+matcher.matches(args[index])); } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing file name matching. */ public static void main(String[] args) { try { System.out.println("Regular expression ["+args[0]+"]"); FileNameParser parser = new FileNameParser(); StringMatcher matcher = parser.parse(args[0]); for (int index = 1; index < args.length; index++) { String string = args[index]; System.out.print("String ["+string+"]"); System.out.println(" -> match = "+matcher.matches(args[index])); } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing file name matching. */ public static void main(String[] args) { try { System.out.println("Regular expression ["+args[0]+"]"); FileNameParser parser = new FileNameParser(); StringMatcher matcher = parser.parse(args[0]); for (int index = 1; index < args.length; index++) { String string = args[index]; System.out.print("String ["+string+"]"); System.out.println(" -> match = "+matcher.matches(args[index])); } } catch (Exception ex) { ex.printStackTrace(); } } }
new ListParser(new FileNameParser()).parse(jarFilter)), jarReader);
/** * Wraps the given DataEntryWriter in a JarWriter, filtering if necessary. */ private static DataEntryWriter wrapInJarWriter(DataEntryWriter writer, boolean isJar, List jarFilter, String jarExtension, boolean dontWrap) { // Zip up jars, if necessary. DataEntryWriter jarWriter = dontWrap ? (DataEntryWriter)new ParentDataEntryWriter(writer) : (DataEntryWriter)new JarWriter(writer); // Add a filter, if specified. DataEntryWriter filteredJarWriter = jarFilter != null? new FilteredDataEntryWriter( new DataEntryParentFilter( new DataEntryNameFilter( new ListParser(new FileNameParser()).parse(jarFilter))), jarWriter) : jarWriter; // Only zip up jars, unless the output is a jar file itself. return new FilteredDataEntryWriter( new DataEntryParentFilter( new DataEntryNameFilter( new ExtensionMatcher(jarExtension))), filteredJarWriter, isJar ? jarWriter : writer); }