Package io.scanbot.sdk.util
Object FileUtils
-
- All Implemented Interfaces:
public class FileUtils
Contains helper methods for working with files and directories
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
SCANBOT_SDK_FILES_DIR
public final static FileUtils
INSTANCE
-
Method Summary
Modifier and Type Method Description final static Boolean
isFileNameSafe(CharSequence name)
final static File
getExternalFilesDirOrShowError(Context context, String directoryName)
Returns external directory with provided name (creates if needed). final static File
getExternalStorageDirOrShowError(String directoryName)
Returns external directory with provided name (creates if needed). final static File
getAppFilesDirOrShowError(Context context, String directoryName)
Returns the application (internal or external) directory with provided name (creates if needed). final static File
getExternalCacheDirOrShowError(Context context, String directoryName)
Returns external cache directory with provided name (creates if needed). final static Boolean
ensureDirExists(String directoryPath)
final static File
getFilesDirOrShowError(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
-
-
-
-