Class SimpleCompareFileExtensions

java.lang.Object
io.github.astrapi69.file.compare.SimpleCompareFileExtensions

public final class SimpleCompareFileExtensions extends Object
  • Method Details

    • compareFilesByAbsolutePath

      public static boolean compareFilesByAbsolutePath(File sourceFile, File fileToCompare)
      Compare files by absolute path.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the absolute path are equal, otherwise false.
    • compareFilesByChecksum

      public static boolean compareFilesByChecksum(File sourceFile, File fileToCompare, io.github.astrapi69.crypt.api.algorithm.Algorithm algorithm) throws NoSuchAlgorithmException, IOException
      Compare files by checksum with the algorithm Adler32.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      algorithm - the algorithm
      Returns:
      true if the checksum with the algorithm Adler32 are equal, otherwise false.
      Throws:
      NoSuchAlgorithmException - Is thrown if the algorithm is not supported or does not exists.
      IOException - Signals that an I/O exception has occurred.
    • compareFilesByChecksumAdler32

      public static boolean compareFilesByChecksumAdler32(File sourceFile, File fileToCompare) throws IOException
      Compare files by checksum with the algorithm Adler32.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the checksum with the algorithm Adler32 are equal, otherwise false.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • compareFilesByChecksumCRC32

      public static boolean compareFilesByChecksumCRC32(File sourceFile, File fileToCompare) throws IOException
      Compare files by checksum with the algorithm CRC32.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the checksum with the algorithm CRC32 are equal, otherwise false.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • compareFilesByContent

      public static boolean compareFilesByContent(File sourceFile, File fileToCompare)
      Compare files by content.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the content are equal, otherwise false.
    • compareFilesByExtension

      public static boolean compareFilesByExtension(File sourceFile, File fileToCompare)
      Compare files by extension.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the extension are equal, otherwise false.
    • compareFilesByLastModified

      public static boolean compareFilesByLastModified(File sourceFile, File fileToCompare)
      Compare files by last modified.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the last modified are equal, otherwise false.
    • compareFilesByLength

      public static boolean compareFilesByLength(File sourceFile, File fileToCompare)
      Compare files by length.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the length are equal, otherwise false.
    • compareFilesByName

      public static boolean compareFilesByName(File sourceFile, File fileToCompare)
      Compare files by name.
      Parameters:
      sourceFile - the source file
      fileToCompare - the file to compare
      Returns:
      true if the name are equal, otherwise false.