Rename and remove operations connected to the contextual menu over items at the list...
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / RenameFileOperation.java
index 58b792e..120a880 100644 (file)
@@ -41,7 +41,7 @@ import eu.alefzero.webdav.WebdavUtils;
  */
 public class RenameFileOperation extends RemoteOperation {
     
-    private static final String TAG = RemoveFileOperation.class.getSimpleName();
+    private static final String TAG = RenameFileOperation.class.getSimpleName();
 
     private static final int RENAME_READ_TIMEOUT = 10000;
     private static final int RENAME_CONNECTION_TIMEOUT = 5000;
@@ -152,12 +152,14 @@ public class RenameFileOperation extends RemoteOperation {
      * IMPORTANT: The test must be made in the same file system where files are download. The internal storage
      * could be formatted with a different file system.
      * 
+     * TODO move this method, and maybe FileDownload.get***Path(), to a class with utilities specific for the interactions with the file system
+     * 
      * @return      'True' if a temporal file named with the name to set could be created in the file system where 
      *              local files are stored.
      */
     private boolean isValidNewName() {
         // check tricky names
-        if (mNewName == null || mNewName.length() <= 0 || mNewName.contains(File.separator)) { 
+        if (mNewName == null || mNewName.length() <= 0 || mNewName.contains(File.separator) || mNewName.contains("%")) { 
             return false;
         }
         // create a test file