Github user arina-ielchiieva commented on a diff in the pull request: https://github.com/apache/drill/pull/1050#discussion_r152773919 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java --- @@ -252,11 +252,15 @@ private static String buildPath(final String[] path, final int folderIndex) { return builder.toString(); } - public static FileSelection create(final DrillFileSystem fs, final String parent, final String path) throws IOException { + public static FileSelection create(final DrillFileSystem fs, final String parent, final String path, + final boolean allowAccessOutsideWorkspace) throws IOException { Stopwatch timer = Stopwatch.createStarted(); boolean hasWildcard = path.contains(WILD_CARD); final Path combined = new Path(parent, removeLeadingSlash(path)); + if (!allowAccessOutsideWorkspace) { + checkBackPaths(parent, combined.toString(), path); --- End diff -- I usually void using `toString` for `Path`, consider using `combined.toUri().getPath()`.
---