diff options
| author | Matt Garnes <matt@cyngn.com> | 2015-08-12 11:32:31 -0700 |
|---|---|---|
| committer | Matt Garnes <matt@cyngn.com> | 2015-08-12 17:39:54 -0700 |
| commit | bd79d582be84824e3a5cc519ef6d9cc8d4518aa9 (patch) | |
| tree | 1cf6053cfdef2f037808d5a7dd0b3254835fdb69 /src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java | |
| parent | b5c78a630e782ccf3ceb7692d1df56e6f2d42ae3 (diff) | |
Improve copy/move performance with nio and reintroduce cancel.
Utilize FileChannel.transferFrom to copy files faster. Chunk the file
transfer so that we can check between each chunk if the user has
cancelled the copy.
In my tests copying a large file (650MB), this improved performance by 45%.
Also, bring the cancel feature back for non secure storage.
Fixes QRDL-976.
Change-Id: I112cee7b9dfe682a438516f7f938dfd7538f1efb
Diffstat (limited to 'src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java')
| -rw-r--r-- | src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java b/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java index c4943b2..a8ac7eb 100644 --- a/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java @@ -83,7 +83,7 @@ public class MoveCommand extends Program implements MoveExecutable { //Move or copy recursively if (d.exists()) { - if (!FileHelper.copyRecursive(s, d, getBufferSize(), this)) { + if (!FileHelper.copyRecursive(s, d, this)) { if (isTrace()) { Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ } @@ -97,7 +97,7 @@ public class MoveCommand extends Program implements MoveExecutable { } else { // Move between filesystem is not allow. If rename fails then use copy operation if (!s.renameTo(d)) { - if (!FileHelper.copyRecursive(s, d, getBufferSize(), this)) { + if (!FileHelper.copyRecursive(s, d, this)) { if (isTrace()) { Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ } |
