packages/apps/CMFileManager
Revision | 25bcc733b630c3ee032b185ab9adfbbd99e4cbbc (tree) |
---|---|
Time | 2015-10-16 08:12:31 |
Author | root <srinivas.p031@gmai...> |
Commiter | Gerrit Code Review |
Secure file moving issue fix
Change-Id: I684124bb32747a39d772b41c48d62c4c236b3ed2
@@ -113,6 +113,13 @@ public class MoveCommand extends Program implements MoveExecutable { | ||
113 | 113 | if (!d.exists()) { |
114 | 114 | throw new ExecutionException("Failed to rename file or directory", ex); |
115 | 115 | } |
116 | + if (s.exists() && d.exists()) { | |
117 | + if (!FileHelper.deleteFileOrFolder(s)) { | |
118 | + if (isTrace()) { | |
119 | + Log.v(TAG, "File copied successfully but not deleted"); //$NON-NLS-1$ | |
120 | + } | |
121 | + } | |
122 | + } | |
116 | 123 | } |
117 | 124 | } |
118 | 125 |