Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Never exclude directories listed in the class path, only sub-folders …
Browse files Browse the repository at this point in the history
…if they cannot be Java packages.
  • Loading branch information
marchof committed Mar 23, 2012
1 parent f7449d6 commit 9997859
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public void walk(IResource resource) throws CoreException, IOException {
in.close();
}
} else {
walkResource(resource);
walkResource(resource, true);
}
}

private void walkResource(IResource resource) throws CoreException,
IOException {
private void walkResource(IResource resource, boolean root)
throws CoreException, IOException {
switch (resource.getType()) {
case IResource.FILE:
if (resource.getName().endsWith(".class")) { //$NON-NLS-1$
Expand All @@ -67,11 +67,11 @@ private void walkResource(IResource resource) throws CoreException,
break;
case IResource.FOLDER:
case IResource.PROJECT:
// Do not traverse into folders like ".svn"
if (isJavaIdentifier(resource.getName())) {
// Do not traverse into sub-folders like ".svn"
if (root || isJavaIdentifier(resource.getName())) {
final IContainer container = (IContainer) resource;
for (final IResource child : container.members()) {
walkResource(child);
walkResource(child, false);
}
}
break;
Expand All @@ -88,11 +88,11 @@ public void walk(IPath path) throws IOException {
in.close();
}
} else {
walkFile(file);
walkFile(file, true);
}
}

private void walkFile(File file) throws IOException {
private void walkFile(File file, boolean root) throws IOException {
if (file.isFile()) {
if (file.getName().endsWith(".class")) { //$NON-NLS-1$
final InputStream in = open(file);
Expand All @@ -104,9 +104,9 @@ private void walkFile(File file) throws IOException {
}
} else {
// Do not traverse into folders like ".svn"
if (isJavaIdentifier(file.getName())) {
if (root || isJavaIdentifier(file.getName())) {
for (final File child : file.listFiles()) {
walkFile(child);
walkFile(child, false);
}
}
}
Expand Down

0 comments on commit 9997859

Please sign in to comment.