Skip to content

Commit

Permalink
added path edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornul11 committed Jul 2, 2023
1 parent 2a346c3 commit c4dce1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
return FileVisitResult.CONTINUE;
}


@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
// supposedly this change would make a huge resume boost

// If directory is hidden and it's not the root, skip
// If directory is hidden, and it's not the root, skip
if (isHidden(dir) && !dir.equals(rootPath)) {
logger.info("Skipping hidden directory: " + dir);
return FileVisitResult.SKIP_SUBTREE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ private void parseJarFilePath(String jarFilePath) {
String version = splitPath[splitPath.length - 2];
String artifactID = splitPath[splitPath.length - 3];

// parts of the Maven dataset are contained in a sub-folder repository, so we have to escape it
int startIdx = 1;
if (splitPath[1].equals("repository")) {
startIdx = 2;
}

StringBuilder groupID = new StringBuilder();
for (int i = 1; i < splitPath.length - 3; i++) {
for (int i = startIdx; i < splitPath.length - 3; i++) {
groupID.append(splitPath[i]);
if (i < splitPath.length - 4) { // don't want a trailing slash
groupID.append('/');
Expand Down

0 comments on commit c4dce1e

Please sign in to comment.