Skip to content

Commit

Permalink
fix for root folder (not include as directory entry)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveti authored and MatousJobanek committed Sep 9, 2015
1 parent 64400d3 commit 1178d34
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,14 @@ private static List<String> fileListing(final File directory) {
}

private static void generateFileList(final List<String> list, final File root, final File file) {

String entryPath =
file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1).replace(File.separatorChar, '/');

if (file.isFile()) {
// SHRINKRES-94 replacing all OS dependent separators with jar independent separator
list.add(entryPath);
list.add(file.getAbsolutePath().substring(
root.getAbsolutePath().length() + 1).replace(File.separatorChar, '/'));
} else if (file.isDirectory()) {
if (!file.equals(root)) {
list.add(entryPath + File.separatorChar);
list.add(file.getAbsolutePath().substring(
root.getAbsolutePath().length() + 1).replace(File.separatorChar, '/') + File.separatorChar);
}
for (File next : file.listFiles()) {
generateFileList(list, root, next);
Expand Down

0 comments on commit 1178d34

Please sign in to comment.