flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request #3219: [FLINK-5659] Harden FileBaseUtils#deleteFileOrDire...
Date Mon, 30 Jan 2017 16:41:27 GMT
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3219#discussion_r98478136
  
    --- Diff: flink-core/src/main/java/org/apache/flink/util/FileUtils.java ---
    @@ -148,14 +158,49 @@ public static void deleteDirectory(File directory) throws IOException
{
     				return;
     			}
     
    -			// delete the directory. this fails if the directory is not empty, meaning
    -			// if new files got concurrently created. we want to fail then.
    -			try {
    -				Files.delete(directory.toPath());
    -			}
    -			catch (NoSuchFileException ignored) {
    -				// if someone else deleted this concurrently, we don't mind
    -				// the result is the same for us, after all
    +			java.nio.file.Path directoryPath = directory.toPath();
    +			if (OperatingSystem.isWindows()) {
    +				// delete the directory. this fails if the directory is not empty, meaning
    --- End diff --
    
    How about moving this to a separate method for readability?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message