moved XML submodule to resources
This commit is contained in:
parent
af91253e42
commit
33e5d3106e
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "APED/app/src/main/java/com/example/aped/xml"]
|
[submodule "APED/app/src/main/res/raw/XML"]
|
||||||
path = APED/app/src/main/java/com/example/aped/xml
|
path = APED/app/src/main/res/raw/XML
|
||||||
url = https://its-gitlab.init.hs-owl.de/mo_b_l/aped_xml_configs.git
|
url = https://its-gitlab.init.hs-owl.de/mo_b_l/aped_xml_configs.git
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.example.aped.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility for getting information related to the external storage.
|
||||||
|
*/
|
||||||
|
public final class ExternalStorageHandler {
|
||||||
|
|
||||||
|
private ExternalStorageHandler() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the external storage is mounted.
|
||||||
|
* @return boolean value
|
||||||
|
*/
|
||||||
|
public static boolean isExternalStorageMounted() {
|
||||||
|
return Environment.MEDIA_MOUNTED.equals(
|
||||||
|
Environment.getExternalStorageState()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the external storage is read only.
|
||||||
|
* @return boolean value
|
||||||
|
*/
|
||||||
|
public static boolean isExternalStorageReadOnly() {
|
||||||
|
return Environment.MEDIA_MOUNTED_READ_ONLY.equals(
|
||||||
|
Environment.getExternalStorageState()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the external private storage base directory path for an activity.
|
||||||
|
* @param context the relevant activity
|
||||||
|
* @return the path to the base of the external private storage
|
||||||
|
* @throws FileNotFoundException checks if the directory is mounted
|
||||||
|
*/
|
||||||
|
public static String getExternalPrivateStorageDir(final Context context)
|
||||||
|
throws FileNotFoundException {
|
||||||
|
if (isExternalStorageMounted()) {
|
||||||
|
File file = context.getExternalCacheDir();
|
||||||
|
return file.getAbsolutePath();
|
||||||
|
} else {
|
||||||
|
throw new FileNotFoundException(
|
||||||
|
"The relevant storage is not available."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 3600828925b4f02fcf472797c5cf526d24f53f63
|
|
1
APED/app/src/main/res/raw/XML
Submodule
1
APED/app/src/main/res/raw/XML
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit ce8ce41609a1a7ef9282cbcdda3358f9c2ec6939
|
Loading…
x
Reference in New Issue
Block a user