AHeise commented on a change in pull request #10570: [FLINK-15248][FileSystems]
Fix the bug in FileUtils#compressDirectory when processing relative directory
path.
URL: https://github.com/apache/flink/pull/10570#discussion_r358668529
##########
File path: flink-core/src/main/java/org/apache/flink/util/FileUtils.java
##########
@@ -493,8 +493,14 @@ public static Path compressDirectory(Path directory, Path
target) throws IOExcep
FileSystem sourceFs = directory.getFileSystem();
FileSystem targetFs = target.getFileSystem();
+ Path absolutePath;
+ if (!directory.isAbsolute()) {
+ absolutePath = new Path(sourceFs.getWorkingDirectory(),
directory);
+ } else {
+ absolutePath = directory;
+ }
Review comment:
Could you please extract to a public method in FileUtils? This seems useful
enough on its own.
I was even thinking of adding it directly to path, but at this point, we
shouldn't change public API anymore.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services