Class FilesUtils

java.lang.Object
com.vdoc.sdk.commons.utils.FilesUtils

public class FilesUtils extends Object
Files utility class
  • Method Details

    • getFileCRC32

      @Deprecated public static Long getFileCRC32(File file) throws IOException
      Deprecated.
      Build the CRC32 for the file using CRC32
      Parameters:
      file - the file
      Returns:
      the CRC32 value
      Throws:
      IOException - on error
      FileNotFoundException - on error
    • getFileCRC16

      public static int getFileCRC16(File file) throws IOException
      Build the CRC16 for the given file
      Parameters:
      file - the given file
      Returns:
      the CRC16
      Throws:
      IOException - on error
      FileNotFoundException - on error
    • getExtension

      public static String getExtension(File file)
      Retrieve the file extension
      Parameters:
      file - the file
      Returns:
      the extension with point or null if no extension found
    • getExtension

      @Deprecated public static String getExtension(String fileName)
      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

      public static String getNameWithoutExtension(File file)
      Retrieve the file name without extension
      Parameters:
      file - the file
      Returns:
      the file name without extension
    • getNameWithoutExtension

      @Deprecated public static String getNameWithoutExtension(String fileName)
      Deprecated.
      Retrieve the file name with extension
      Parameters:
      fileName - the filename
      Returns:
      the file name with extension
    • createTempFile

      public static File createTempFile(String fileName) throws IOException
      Create a temporary file for the given fileName
      Parameters:
      fileName - the file name
      Returns:
      the new created file
      Throws:
      IOException - on error
    • byteCountToDisplaySize

      public static String byteCountToDisplaySize(long size, IModule module)
      Byte count to display size
      Parameters:
      size - the size
      module - the module
      Returns:
      the display size