- }
-
- private void saveLocalFile() {
- /*
- mFile.setRFileName(mNewName); <<< NO >
-
- // try to move the local copy of the file
- if (mFile.isDown()) {
- File f = new File(mFile.getStoragePath());
- String parentStoragePath = f.getParent();
- if (!parentStoragePath.endsWith(File.separator))
- parentStoragePath += File.separator;
- if (f.renameTo(new File())) {
- mFile.setStoragePath(parentStoragePath + mNewName);
- }
- // else - NOTHING: the link to the local file is kept although the local name can't be updated
- // TODO - study conditions when this could be a problem
- }
-
- getStorageManager().saveFile(mFile);
- */
- }
-
- /**
- * Checks if the new name to set is valid in the file system
- *
- * The only way to be sure is trying to create a file with that name. It's made in the temporal directory
- * for downloads, out of any account, and then removed.
- *
- * 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.
- * @throws IOException When the temporal folder can not be created.
- */
- private boolean isValidNewName() throws IOException {