diff --git a/app/src/main/java/com/nutomic/syncthingandroid/util/FileUtils.java b/app/src/main/java/com/nutomic/syncthingandroid/util/FileUtils.java index f4d2613d..c81b96a3 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/util/FileUtils.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/util/FileUtils.java @@ -115,8 +115,7 @@ public class FileUtils { } if (DOWNLOADS_VOLUME_NAME.equals(volumeId)) { Log.v(TAG, "getVolumePath: isDownloadsVolume"); - // Reading the environment var avoids hard coding the case of the "downloads" folder. - return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); + return getExternalStorageDownloadsDirectory(); } StorageManager mStorageManager = @@ -237,6 +236,13 @@ public class FileUtils { else return File.separator; } + /** + * Reading the environment var avoids hard coding the absolute path of the "/Download" folder. + */ + public static String getExternalStorageDownloadsDirectory() { + return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); + } + @Nullable public static String cutTrailingSlash(final String path) { if (path.endsWith(File.separator)) {