Added folder name to 'file not found' error message
authorjabarros <jabarros@solidgear.es>
Wed, 7 Jan 2015 12:04:46 +0000 (13:04 +0100)
committerjabarros <jabarros@solidgear.es>
Wed, 7 Jan 2015 12:04:46 +0000 (13:04 +0100)
res/values/strings.xml
src/com/owncloud/android/utils/ErrorMessageAdapter.java

index c26a31c..249f256 100644 (file)
        <string name="prefs_category_security">Security</string>
 
        <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
-    <string name="download_folder_not_found">The folder is no longer available on the server</string>
-    <string name="downloader_download_folder_failed_content">Download of %1$s folder could not be completed</string>
+    <string name="download_folder_not_found">The %1$s folder is no longer available on the server</string>
+    <string name="download_folder_failed_content">Download of %1$s folder could not be completed</string>
 
 </resources>
index 9e077c0..992f0f6 100644 (file)
@@ -210,13 +210,16 @@ public class ErrorMessageAdapter {
         } else if (operation instanceof SynchronizeFolderOperation) {
 
             if (!result.isSuccess()) {
+                String folderPathName = new File(
+                        ((SynchronizeFolderOperation) operation).getFolderPath()).getName();
                 if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
-                    message = res.getString(R.string.download_folder_not_found);
+                    message = String.format(res.getString(R.string.download_folder_not_found),
+                            folderPathName);
 
                 } else {    // Generic error
                     // Show a Message, operation finished without success
-                    message = String.format(res.getString(R.string.downloader_download_folder_failed_content), new File(
-                            ((SynchronizeFolderOperation) operation).getFolderPath()).getName());
+                    message = String.format(res.getString(R.string.download_folder_failed_content),
+                            folderPathName);
                 }
             }
         }