#492 ignore .svn / .cvs dir while scanning files

Future
closed
nobody
None
5
2016-02-28
2008-09-16
Anonymous
No

The application should not check metadata files hidden in "." sub directories while traversing files to check.

In particular, you should avoid all ".svn" and ".CVS" dirs (where some data files are duplicates from subversion/CVS repositories) ...

corrective patch:
In class Main.java, add a test for "if (! aNode.getName().startsWith(".")) {" in method traverse()

private static void traverse(File aNode, List<File> aFiles)
{
    if (aNode.canRead()) {
        if (aNode.isDirectory()) {
            if (! aNode.getName().startsWith(".")) {
                final File[] nodes = aNode.listFiles();
                for (File element : nodes) {
                    traverse(element, aFiles);
                }
            } else {
                // ignore .cvs, .svn ...
            }
        }
        else if (aNode.isFile()) {
            aFiles.add(aNode);
        }
    }
}

instead of

private static void traverse(File aNode, List<File> aFiles)
{
    if (aNode.canRead()) {
        if (aNode.isDirectory()) {
            final File[] nodes = aNode.listFiles();
            for (File element : nodes) {
                traverse(element, aFiles);
            }
        }
        else if (aNode.isFile()) {
            aFiles.add(aNode);
        }
    }
}

Discussion

  • Oliver Burn

    Oliver Burn - 2008-09-18

    this is a feature request

     
  • Roman Ivanov

    Roman Ivanov - 2016-02-28
    • status: open --> closed
    • Group: --> Future
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks