mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-01 16:51:16 +00:00
FileUtils: Move getExternalStorageDownloadsDirectory code into separate function
This commit is contained in:
parent
cc76014207
commit
4ef5853b88
1 changed files with 8 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue