Package com.vdoc.sdk.commons.utils
Class FilesUtils
java.lang.Object
com.vdoc.sdk.commons.utils.FilesUtils
Files utility class
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteCountToDisplaySize(long size, IModule module) Byte count to display sizestatic FilecreateTempFile(String fileName) Create a temporary file for the given fileNamestatic StringgetExtension(File file) Retrieve the file extensionstatic StringgetExtension(String fileName) Deprecated.static intgetFileCRC16(File file) Build the CRC16 for the given filestatic LonggetFileCRC32(File file) Deprecated.static StringgetNameWithoutExtension(File file) Retrieve the file name without extensionstatic StringgetNameWithoutExtension(String fileName) Deprecated.
-
Method Details
-
getFileCRC32
Deprecated.Build the CRC32 for the file usingCRC32- Parameters:
file- the file- Returns:
- the CRC32 value
- Throws:
IOException- on errorFileNotFoundException- on error
-
getFileCRC16
Build the CRC16 for the given file- Parameters:
file- the given file- Returns:
- the CRC16
- Throws:
IOException- on errorFileNotFoundException- on error
-
getExtension
Retrieve the file extension- Parameters:
file- the file- Returns:
- the extension with point or null if no extension found
-
getExtension
Deprecated.Retrieve the file extension from its name- Parameters:
fileName- the file's name- Returns:
- the extension with point or null if no extension found
-
getNameWithoutExtension
Retrieve the file name without extension- Parameters:
file- the file- Returns:
- the file name without extension
-
getNameWithoutExtension
Deprecated.Retrieve the file name with extension- Parameters:
fileName- the filename- Returns:
- the file name with extension
-
createTempFile
Create a temporary file for the given fileName- Parameters:
fileName- the file name- Returns:
- the new created file
- Throws:
IOException- on error
-
byteCountToDisplaySize
Byte count to display size- Parameters:
size- the sizemodule- the module- Returns:
- the display size
-