Skip to content

Commit

Permalink
first commit (#2401)
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 authored Jan 13, 2022
1 parent 6e8837b commit 96a9c22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/apoc/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import apoc.util.hdfs.HDFSUtils;
import apoc.util.s3.S3URLConnection;
import apoc.util.s3.S3UploadUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.neo4j.configuration.GraphDatabaseSettings;

Expand Down Expand Up @@ -193,7 +194,7 @@ private static Path resolvePath(String url) throws IOException {
}

private static Path relativizeIfSamePrefix(Path urlPath, Path basePath) {
if (urlPath.isAbsolute() && !urlPath.startsWith(basePath.toAbsolutePath())) {
if (FilenameUtils.getPrefixLength(urlPath.toString()) > 0 && !urlPath.startsWith(basePath.toAbsolutePath())) {
// if the import folder is configured to be used as root folder we consider
// it as root directory in order to reproduce the same LOAD CSV behaviour
urlPath = urlPath.getRoot().relativize(urlPath);
Expand Down

0 comments on commit 96a9c22

Please sign in to comment.