Class FileSignature

java.lang.Object
com.diffplug.spotless.FileSignature
All Implemented Interfaces:
Serializable

public final class FileSignature extends Object implements Serializable
Computes a signature for any needed files.
See Also:
  • Method Details

    • signAsList

      public static FileSignature signAsList(File... files) throws IOException
      Creates file signature whereas order of the files remains unchanged.
      Throws:
      IOException
    • signAsList

      public static FileSignature signAsList(Iterable<File> files) throws IOException
      Creates file signature whereas order of the files remains unchanged.
      Throws:
      IOException
    • signAsSet

      public static FileSignature signAsSet(File... files) throws IOException
      Creates file signature whereas order of the files remains unchanged.
      Throws:
      IOException
    • signAsSet

      public static FileSignature signAsSet(Iterable<File> files) throws IOException
      Creates file signature insensitive to the order of the files.
      Throws:
      IOException
    • asPromise

      public FileSignature.Promised asPromise()
    • promise

      public static FileSignature.Promised promise(Iterable<File> files)
    • promise

      public static FileSignature.Promised promise(File file)
    • files

      public Collection<File> files()
      Returns all of the files in this signature, throwing an exception if there are more or less than 1 file.
    • getOnlyFile

      public File getOnlyFile()
      Returns the only file in this signature, throwing an exception if there are more or less than 1 file.
    • machineIsWin

      public static boolean machineIsWin()
      Returns true if this JVM is running on a windows machine.
    • pathNativeToUnix

      public static String pathNativeToUnix(String pathNative)
      Transforms a native path to a unix one.
    • pathUnixToNative

      public static String pathUnixToNative(String pathUnix)
      Transforms a unix path to a native one.
    • subpath

      public static String subpath(String root, String child)
      Asserts that child is a subpath of root. and returns the subpath.