public class FileUtils
Contains helper methods for working with files and directories
@NotNull public static java.lang.String SCANBOT_SDK_FILES_DIR
public static FileUtils INSTANCE
Contains helper methods for working with files and directories
@JvmStatic
public static boolean isFileNameSafe(@NotNull
java.lang.CharSequence name)
true if filename can be used on filesystem. false otherwise.@JvmStatic
@NotNull
public static java.io.File getExternalFilesDirOrShowError(@NotNull
android.content.Context context,
@Nullable
java.lang.String directoryName)
Returns external directory with provided name (creates if needed). On failure shows toast message.
directoryName - name of the directory being createdcontext - IOException - in case if IO failure@JvmStatic
@NotNull
public static java.io.File getExternalStorageDirOrShowError(@Nullable
java.lang.String directoryName)
Returns external directory with provided name (creates if needed). On failure shows toast message.
directoryName - name of the directory being createdIOException - in case if IO failure@JvmStatic
@NotNull
public static java.io.File getAppFilesDirOrShowError(@NotNull
android.content.Context context,
@Nullable
java.lang.String directoryName)
Returns the application (internal or external) directory with provided name (creates if needed). On failure shows toast message.
directoryName - name of the directory being createdcontext - IOException - in case if IO failure@JvmStatic
@NotNull
public static java.io.File getExternalCacheDirOrShowError(@NotNull
android.content.Context context,
@Nullable
java.lang.String directoryName)
Returns external cache directory with provided name (creates if needed). On failure shows toast message.
directoryName - name of the directory being createdcontext - IOException - in case if IO failure@JvmStatic
public static boolean ensureDirExists(@Nullable
java.lang.String directoryPath)
directoryPath - path to directorytrue if directory exists, false - otherwise@JvmStatic
@NotNull
public static java.io.File getFilesDirOrShowError(@Nullable
java.lang.String parentDirPath,
@Nullable
java.lang.String directoryName)
Returns directory with provided path (creates if needed). On failure shows toast message.
parentDirPath - path to the parent directorydirectoryName - name of the directory being createdIOException - in case if IO failure