Package net.sourceforge.fullsync.rules.filefilter

Examples of net.sourceforge.fullsync.rules.filefilter.FileFilterManager


    simpleRuleSetElement.setAttribute("patternsType", getPatternsType());
    simpleRuleSetElement.setAttribute("ignorePattern", getIgnorePattern());
    simpleRuleSetElement.setAttribute("takePattern", getTakePattern());
    simpleRuleSetElement.setAttribute("useFilter", String.valueOf(isUseFilter()));

    FileFilterManager filterManager = new FileFilterManager();

    if (fileFilter != null) {
      Element fileFilterElement = filterManager.serializeFileFilter(getFileFilter(), document, "FileFilter", "FileFilterRule");
      simpleRuleSetElement.appendChild(fileFilterElement);
    }

    if (fileFilterTree != null) {
      HashMap<String, FileFilter> itemsMap = fileFilterTree.getItemsMap();
      Set<Entry<String, FileFilter>> entrySet = itemsMap.entrySet();
      for (Entry<String, FileFilter> entry : entrySet) {
        String path = entry.getKey();
        FileFilter filter = entry.getValue();
        Element subdirFilterElement = document.createElement("SubdirectoryFileFilter");
        subdirFilterElement.setAttribute("path", path);
        Element fileFilterElement = filterManager.serializeFileFilter(filter, document, "FileFilter", "FileFilterRule");
        subdirFilterElement.appendChild(fileFilterElement);
        simpleRuleSetElement.appendChild(subdirFilterElement);
      }
    }
View Full Code Here


      if ((useFilterStr != null) && (!useFilterStr.equals(""))) {
        useFilter = Boolean.valueOf(useFilterStr).booleanValue();
      }
      NodeList fileFilterNodeList = simpleRuleSetConfigElement.getElementsByTagName("FileFilter");
      if (fileFilterNodeList.getLength() > 0) {
        FileFilterManager filterManager = new FileFilterManager();
        Element fileFilterElement = (Element) fileFilterNodeList.item(0);
        fileFilter = filterManager.unserializeFileFilter(fileFilterElement, "FileFilterRule");

        NodeList subdirFiltersNodeList = simpleRuleSetConfigElement.getElementsByTagName("SubdirectoryFileFilter");
        int numOfDirs = subdirFiltersNodeList.getLength();
        fileFilterTree = new FileFilterTree();
        for (int i = 0; i < numOfDirs; i++) {
          Element subDirElement = (Element) subdirFiltersNodeList.item(i);
          String path = subDirElement.getAttribute("path");
          fileFilterNodeList = subDirElement.getElementsByTagName("FileFilter");
          if (fileFilterNodeList.getLength() > 0) {
            Element subDirFileFilterElement = (Element) fileFilterNodeList.item(0);
            FileFilter subDirFileFilter = filterManager.unserializeFileFilter(subDirFileFilterElement, "FileFilterRule");

            fileFilterTree.addFileFilter(path, subDirFileFilter);
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.rules.filefilter.FileFilterManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.