test_class.file: shared/src/test/java/org/eclipse/steady/shared/util/DirUtilTest.java
test_class.identifier: DirUtilTest
test_case.body: @Test
    public void testFilterSubpaths() {
      final Path p1 = Paths.get("./src/test/resources/foo/bar/empty.txt");
      final Path p2 = Paths.get("./src/test/resources/foo/bar");
      final Path p3 = Paths.get("./src/test/resources/foo");
      final Path p4 = Paths.get("./src/test/resources/foo/empty");
  
      final Set<Path> filter = new HashSet<Path>();
      filter.add(p2);
      final Set<Path> to_be_filtered = new HashSet<Path>();
      to_be_filtered.add(p1);
      to_be_filtered.add(p3);
      to_be_filtered.add(p4);
  
      final Set<Path> r1 = DirUtil.filterSubpaths(to_be_filtered, filter, true);
      assertEquals(1, r1.size());
  
      final Set<Path> r2 = DirUtil.filterSubpaths(to_be_filtered, filter, false);
      assertEquals(2, r2.size());
    }
test_case.class_method_signature: DirUtilTest.testFilterSubpaths()
test_case.full_signature: @Test public void testFilterSubpaths()
test_case.identifier: testFilterSubpaths
test_case.invocations: get get get get add add add add filterSubpaths assertEquals size filterSubpaths assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFilterSubpaths()
focal_class.declarator: log = org.apache.logging.log4j.LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: shared/src/main/java/org/eclipse/steady/shared/util/DirUtil.java
focal_class.identifier: DirUtil
focal_class.class_method_signature: DirUtil.containsFile(final File _dir, final String _filename)
focal_class.full_signature: public static final boolean containsFile(final File _dir, final String _filename)
focal_class.identifier: containsFile
focal_class.modifiers: public static final
focal_class.parameters: (final File _dir, final String _filename)
focal_class.return: boolean
focal_class.signature: boolean containsFile(final File _dir, final String _filename)
focal_class.class_method_signature: DirUtil.getAllFiles(final File _dir, final String[] _ignore)
focal_class.full_signature: public static File[] getAllFiles(final File _dir, final String[] _ignore)
focal_class.identifier: getAllFiles
focal_class.modifiers: public static
focal_class.parameters: (final File _dir, final String[] _ignore)
focal_class.return: File[]
focal_class.signature: File[] getAllFiles(final File _dir, final String[] _ignore)
focal_class.class_method_signature: DirUtil.unzip(final File _zip, File _out_dir)
focal_class.full_signature: public static File unzip(final File _zip, File _out_dir)
focal_class.identifier: unzip
focal_class.modifiers: public static
focal_class.parameters: (final File _zip, File _out_dir)
focal_class.return: File
focal_class.signature: File unzip(final File _zip, File _out_dir)
focal_class.class_method_signature: DirUtil.isBelowDestinationPath(Path _destination_path, String _entry_name)
focal_class.full_signature: public static boolean isBelowDestinationPath(Path _destination_path, String _entry_name)
focal_class.identifier: isBelowDestinationPath
focal_class.modifiers: public static
focal_class.parameters: (Path _destination_path, String _entry_name)
focal_class.return: boolean
focal_class.signature: boolean isBelowDestinationPath(Path _destination_path, String _entry_name)
focal_class.class_method_signature: DirUtil.filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_class.full_signature: public static Set<Path> filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_class.identifier: filterSubpaths
focal_class.modifiers: public static
focal_class.parameters: (
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_class.return: Set<Path>
focal_class.signature: Set<Path> filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_class.class_method_signature: DirUtil.getDigest(final File _dir, final String[] _ignore, DigestAlgorithm _alg)
focal_class.full_signature: public static String getDigest(final File _dir, final String[] _ignore, DigestAlgorithm _alg)
focal_class.identifier: getDigest
focal_class.modifiers: public static
focal_class.parameters: (final File _dir, final String[] _ignore, DigestAlgorithm _alg)
focal_class.return: String
focal_class.signature: String getDigest(final File _dir, final String[] _ignore, DigestAlgorithm _alg)
focal_method.body: public static Set<Path> filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths) {
      final Set<Path> result = new HashSet<Path>();
      for (Path p1 : _to_be_filtered) {
        boolean is_sub = false;
        for (Path p2 : _filter) {
          if (p1.startsWith(p2)) {
            is_sub = true;
            if (_keep_subpaths) {
              result.add(p1);
              break;
            }
          }
        }
        if (!_keep_subpaths && !is_sub) {
          result.add(p1);
        }
      }
      return result;
    }
focal_method.class_method_signature: DirUtil.filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_method.full_signature: public static Set<Path> filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_method.identifier: filterSubpaths
focal_method.invocations: startsWith add add
focal_method.modifiers: public static
focal_method.parameters: (
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)
focal_method.return: Set<Path>
focal_method.signature: Set<Path> filterSubpaths(
        Set<Path> _to_be_filtered, Set<Path> _filter, boolean _keep_subpaths)