Package io.scanbot.sdk.util
Object FileUtils
-
- All Implemented Interfaces:
public class FileUtilsContains helper methods for working with files and directories
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringSCANBOT_SDK_FILES_DIRpublic final static FileUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final static BooleanisFileNameSafe(CharSequence name)final static FilegetExternalFilesDirOrShowError(Context context, String directoryName)Returns external directory with provided name (creates if needed). final static FilegetExternalStorageDirOrShowError(String directoryName)Returns external directory with provided name (creates if needed). final static FilegetAppFilesDirOrShowError(Context context, String directoryName)Returns the application (internal or external) directory with provided name (creates if needed). final static FilegetExternalCacheDirOrShowError(Context context, String directoryName)Returns external cache directory with provided name (creates if needed). final static BooleanensureDirExists(String directoryPath)final static FilegetFilesDirOrShowError(String parentDirPath, String directoryName)Returns directory with provided path (creates if needed). -
-
Method Detail
-
isFileNameSafe
final static Boolean isFileNameSafe(CharSequence name)
-
getExternalFilesDirOrShowError
final static File getExternalFilesDirOrShowError(Context context, String directoryName)
Returns external directory with provided name (creates if needed). On failure shows toast message.
- Parameters:
directoryName- name of the directory being created
-
getExternalStorageDirOrShowError
final static File getExternalStorageDirOrShowError(String directoryName)
Returns external directory with provided name (creates if needed). On failure shows toast message.
- Parameters:
directoryName- name of the directory being created
-
getAppFilesDirOrShowError
final static File getAppFilesDirOrShowError(Context context, String directoryName)
Returns the application (internal or external) directory with provided name (creates if needed). On failure shows toast message.
- Parameters:
directoryName- name of the directory being created
-
getExternalCacheDirOrShowError
final static File getExternalCacheDirOrShowError(Context context, String directoryName)
Returns external cache directory with provided name (creates if needed). On failure shows toast message.
- Parameters:
directoryName- name of the directory being created
-
ensureDirExists
final static Boolean ensureDirExists(String directoryPath)
- Parameters:
directoryPath- path to directory
-
getFilesDirOrShowError
final static File getFilesDirOrShowError(String parentDirPath, String directoryName)
Returns directory with provided path (creates if needed). On failure shows toast message.
- Parameters:
parentDirPath- path to the parent directorydirectoryName- name of the directory being created
-
-
-
-