* make ACLs match target destination

This commit is contained in:
Reinhard Pointner 2014-08-05 08:52:15 +00:00
parent 0f47606ac0
commit 83463e09e3
1 changed files with 13 additions and 21 deletions

View File

@ -1,7 +1,5 @@
package net.filebot;
import static java.util.Collections.*;
import static net.filebot.util.FileUtilities.*;
@ -17,12 +15,9 @@ import com.sun.jna.platform.win32.Shell32;
import com.sun.jna.platform.win32.ShellAPI;
import com.sun.jna.platform.win32.ShellAPI.SHFILEOPSTRUCT;
public enum NativeRenameAction implements RenameAction {
MOVE,
COPY;
MOVE, COPY;
@Override
public File rename(File src, File dst) throws IOException {
@ -31,7 +26,6 @@ public enum NativeRenameAction implements RenameAction {
return dst;
}
public void rename(Map<File, File> map) throws IOException {
String[] src = new String[map.size()];
String[] dst = new String[map.size()];
@ -47,12 +41,11 @@ public enum NativeRenameAction implements RenameAction {
callNative_Shell32(this, src, dst);
}
private static void callNative_Shell32(NativeRenameAction action, String[] src, String[] dst) {
// configure parameter structure
SHFILEOPSTRUCT op = new SHFILEOPSTRUCT();
op.wFunc = (action == MOVE) ? ShellAPI.FO_MOVE : ShellAPI.FO_COPY;
op.fFlags = Shell32.FOF_MULTIDESTFILES | Shell32.FOF_NOCONFIRMATION | Shell32.FOF_NOCONFIRMMKDIR;
op.fFlags = Shell32.FOF_MULTIDESTFILES | Shell32.FOF_NOCOPYSECURITYATTRIBS | Shell32.FOF_NOCONFIRMATION | Shell32.FOF_NOCONFIRMMKDIR;
op.pFrom = new WString(op.encodePaths(src));
op.pTo = new WString(op.encodePaths(dst));
@ -64,7 +57,6 @@ public enum NativeRenameAction implements RenameAction {
}
}
public static boolean isSupported() {
try {
return Platform.isWindows();