[
https://issues.apache.org/jira/browse/STORM-1629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15195463#comment-15195463
]
ASF GitHub Bot commented on STORM-1629:
---------------------------------------
GitHub user HeartSaVioR opened a pull request:
https://github.com/apache/storm/pull/1214
STORM-1629 Files/move doesn't work properly with non-empty directory in
Windows
Please refer https://issues.apache.org/jira/browse/STORM-1629 to see why
Files/move with non-empty directory fails on Windows.
* Use FileUtils/moveDirectory on Windows
* It copies whole contents inside directory, and delete directory
* Keep using Files/move on non-Windows
* it's still better option since doesn't require copying contents inside
directory
Since `on-windows?` is ported to Java, I'll create separate pull request
for 1.x-branch.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HeartSaVioR/storm STORM-1629
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1214.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1214
----
commit 02f9308d80da67b6da634b96a08e169268bd9262
Author: Jungtaek Lim <[email protected]>
Date: 2016-03-15T15:06:58Z
STORM-1629 Files/move doesn't work properly with non-empty directory in
Windows
* Use FileUtils/moveDirectory on Windows
* It copies whole contents inside directory, and delete directory
* Keep using Files/move on non-Windows
* it's still better option since doesn't require copying contents inside
directory
----
> Files/move doesn't work properly with non-empty directory in Windows
> --------------------------------------------------------------------
>
> Key: STORM-1629
> URL: https://issues.apache.org/jira/browse/STORM-1629
> Project: Apache Storm
> Issue Type: Bug
> Components: storm-core
> Affects Versions: 1.0.0, 2.0.0
> Environment: Windows
> Reporter: Jungtaek Lim
> Assignee: Jungtaek Lim
> Priority: Blocker
>
> Distributed version of download-storm-code uses Files#move().
> It runs well on *Nix (including OSX) but fails on Windows.
> Javadoc describes this behavior, please refer below link.
> https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#move(java.nio.file.Path,%20java.nio.file.Path,%20java.nio.file.CopyOption...)
> {quote}
> When invoked to move a directory that is not empty then the directory is
> moved if it does not require moving the entries in the directory. For
> example, renaming a directory on the same FileStore will usually not require
> moving the entries in the directory. When moving a directory requires that
> its entries be moved then this method fails (by throwing an IOException). To
> move a file tree may involve copying rather than moving directories and this
> can be done using the copy method in conjunction with the Files.walkFileTree
> utility method.
> {quote}
> If directory is not empty, file system should treat "move directory" as
> "rename".
> Unfortunately, file system on Windows 8 doesn't.
> We should change the way to be compatible with both kinds of OS.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)