-
- All Implemented Interfaces:
public class FileUtil
-
-
Method Summary
Modifier and Type Method Description final FilegetInternalDir(String path, Boolean createIfNecessary)final BooleancontainsFiles(String path)final StringgenerateCacheFilePathFromNonceOrPrefix(Context activity, String nonce, String prefix)final Message.AttachmentcreateLocalStoredAttachment(Activity activity, String uriString, String nonce)This method creates a cached file copying from the input stream. final Message.AttachmentcreateLocalStoredAttachmentFile(Activity activity, InputStream inputStream, String sourceUri, String localFilePath, String mimeType)This method creates a cached file copy from the source input stream. final BooleanisMimeTypeImage(String mimeType)final UnitwriteFileData(String fileLocation, ByteArray data)final ByteArrayreadFileData(String fileLocation)final ByteArrayreadFile(File file)final UnitverifyAllDataRead(File file, ByteArray data, Integer read)final UnitensureClosed(Closeable stream)final UnitdeleteUnrecoverableStorageFiles(File fileOrDirectory)final UnitdeleteFile(String filePath)final BooleanisConversationCacheStoredInLegacyFormat(String filePath)-
-
Method Detail
-
getInternalDir
@WorkerThread() final File getInternalDir(String path, Boolean createIfNecessary)
-
containsFiles
final Boolean containsFiles(String path)
-
generateCacheFilePathFromNonceOrPrefix
final String generateCacheFilePathFromNonceOrPrefix(Context activity, String nonce, String prefix)
-
createLocalStoredAttachment
final Message.Attachment createLocalStoredAttachment(Activity activity, String uriString, String nonce)
This method creates a cached file copying from the input stream. Compresses if image type.
- Parameters:
uriString- the local file path urinonce- the generated nonce of the message
-
createLocalStoredAttachmentFile
final Message.Attachment createLocalStoredAttachmentFile(Activity activity, InputStream inputStream, String sourceUri, String localFilePath, String mimeType)
This method creates a cached file copy from the source input stream.
- Parameters:
inputStream- the source input streamsourceUri- the local file path urilocalFilePath- the cache file path stringmimeType- the mimeType of the source input stream
-
isMimeTypeImage
final Boolean isMimeTypeImage(String mimeType)
-
writeFileData
final Unit writeFileData(String fileLocation, ByteArray data)
-
readFileData
final ByteArray readFileData(String fileLocation)
-
verifyAllDataRead
final Unit verifyAllDataRead(File file, ByteArray data, Integer read)
-
ensureClosed
final Unit ensureClosed(Closeable stream)
-
deleteUnrecoverableStorageFiles
final Unit deleteUnrecoverableStorageFiles(File fileOrDirectory)
-
deleteFile
final Unit deleteFile(String filePath)
-
isConversationCacheStoredInLegacyFormat
final Boolean isConversationCacheStoredInLegacyFormat(String filePath)
-
-
-
-