public boolean accept(File pathname) { if (doNotCopy != null && doNotCopy.matcher(pathname.getName()).matches()) { return false; } if (pathname.isDirectory() && isRecursive()) { return true; } if (instruction == null) { return true; } return !instruction.isNegated() == instruction.matches(pathname.getName()); } }
public boolean accept(File pathname) { if (doNotCopy != null && doNotCopy.matcher(pathname.getName()).matches()) { return false; } if (pathname.isDirectory() && isRecursive()) { return true; } if (instruction == null) { return true; } return !instruction.isNegated() == instruction.matches(pathname.getName()); } }
public boolean accept(File pathname) { if (doNotCopy != null && doNotCopy.matcher(pathname.getName()).matches()) { return false; } if (pathname.isDirectory() && isRecursive()) { return true; } if (instruction == null) { return true; } return !instruction.isNegated() == instruction.matches(pathname.getName()); } }
@Override public boolean accept(File pathname) { if (doNotCopy != null && doNotCopy.matcher(pathname.getName()) .matches()) { return false; } if (pathname.isDirectory() && isRecursive()) { return true; } if (instruction == null) { return true; } return instruction.matches(pathname.getName()) ^ instruction.isNegated(); } }
void tree(List<String> list, File current, String path, Instruction instr) { if (path.length() > 0) path = path + "/"; String subs[] = current.list(); if (subs != null) { for (String sub : subs) { File f = new File(current, sub); if (f.isFile()) { if (instr.matches(sub) ^ instr.isNegated()) list.add(path + sub); } else tree(list, f, path + sub, instr); } } }
public <T> Collection<T> reject(Collection<T> set) { List<T> input = new ArrayList<>(set); List<T> result = new ArrayList<>(); for (Instruction instruction : keySet()) { for (Iterator<T> o = input.iterator(); o.hasNext();) { T oo = o.next(); String s = oo.toString(); if (instruction.matches(s)) { if (instruction.isNegated()) result.add(oo); o.remove(); } else result.add(oo); } } return result; }
public <T> Collection<T> reject(Collection<T> set) { List<T> input = new ArrayList<T>(set); List<T> result = new ArrayList<T>(); for (Instruction instruction : keySet()) { for (Iterator<T> o = input.iterator(); o.hasNext();) { T oo = o.next(); String s = oo.toString(); if (instruction.matches(s)) { if (instruction.isNegated()) result.add(oo); o.remove(); } else result.add(oo); } } return result; }
void tree(List<String> list, File current, String path, Instruction instr) { if (path.length() > 0) path = path + "/"; String subs[] = current.list(); if (subs != null) { for (String sub : subs) { File f = new File(current, sub); if (f.isFile()) { if (instr.matches(sub) && !instr.isNegated()) list.add(path + sub); } else tree(list, f, path + sub, instr); } } }
void tree(List<String> list, File current, String path, Instruction instr) { if (path.length() > 0) path = path + "/"; String subs[] = current.list(); if (subs != null) { for (String sub : subs) { File f = new File(current, sub); if (f.isFile()) { if (instr.matches(sub) && !instr.isNegated()) list.add(path + sub); } else tree(list, f, path + sub, instr); } } }
void tree(List<String> list, File current, String path, Instruction instr) { if (path.length() > 0) path = path + "/"; String subs[] = current.list(); if (subs != null) { for (String sub : subs) { File f = new File(current, sub); if (f.isFile()) { if (instr.matches(sub) && !instr.isNegated()) list.add(path + sub); } else tree(list, f, path + sub, instr); } } }
void tree(List<String> list, File current, String path, Instruction instr) { if (path.length() > 0) path = path + "/"; String subs[] = current.list(); if (subs != null) { for (String sub : subs) { File f = new File(current, sub); if (f.isFile()) { if (instr.matches(sub) ^ instr.isNegated()) list.add(path + sub); } else tree(list, f, path + sub, instr); } } }
public <T> Collection<T> reject(Collection<T> set) { List<T> input = new ArrayList<T>(set); List<T> result = new ArrayList<T>(); for (Instruction instruction : keySet()) { for (Iterator<T> o = input.iterator(); o.hasNext();) { T oo = o.next(); String s = oo.toString(); if (instruction.matches(s)) { if (instruction.isNegated()) result.add(oo); o.remove(); } else result.add(oo); } } return result; }
@Override public boolean accept(File pathname) { if (doNotCopy != null && doNotCopy.matcher(pathname.getName()) .matches()) { return false; } if (pathname.isDirectory() && isRecursive()) { return true; } if (instruction == null) { return true; } return instruction.matches(pathname.getName()) ^ instruction.isNegated(); } }
public boolean matches(String value) { if (size() == 0) return true; Instruction instr = matcher(value); if (instr == null || instr.isNegated()) return false; // we deny this one explicitly return true; }
public boolean matches(String value) { if (size() == 0) return true; Instruction instr = matcher(value); if (instr == null || instr.isNegated()) return false; // we deny this one explicitly return true; }
public boolean matches(String value) { if (size() == 0) return true; Instruction instr = matcher(value); if (instr == null || instr.isNegated()) return false; // we deny this one explicitly return true; }
public boolean matches(String value) { if (size() == 0) return true; Instruction instr = matcher(value); if (instr == null || instr.isNegated()) return false; // we deny this one explicitly return true; }
boolean matches( String text ) { boolean result; if ( null == text ) { result = m_instruction.matches( m_defaultValue ); } else { result = m_instruction.matches( text ); } return m_instruction.isNegated() ? !result : result; } }
public boolean matches(String value) { if (size() == 0) return true; for (Instruction i : keySet()) { if (i.matches(value)) { if (i.isNegated()) return false; // we deny this one explicitly return true; // we allow it explicitly } } return false; }
/** * Add all the resources in the given jar that match the given filter. * * @param sub the jar * @param filter a pattern that should match the resoures in sub to be added */ public boolean addAll(Jar to, Jar sub, Instruction filter, String destination) { boolean dupl = false; for (String name : sub.getResources() .keySet()) { if ("META-INF/MANIFEST.MF".equals(name)) continue; if (filter == null || filter.matches(name) ^ filter.isNegated()) dupl |= to.putResource(Processor.appendPath(destination, name), sub.getResource(name), true); } return dupl; }