Package com.diffplug.spotless
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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<File>
files()
Returns all of the files in this signature, throwing an exception if there are more or less than 1 file.File
getOnlyFile()
Returns the only file in this signature, throwing an exception if there are more or less than 1 file.static boolean
machineIsWin()
Returns true if this JVM is running on a windows machine.static String
pathNativeToUnix(String pathNative)
Transforms a native path to a unix one.static String
pathUnixToNative(String pathUnix)
Transforms a unix path to a native one.static FileSignature
signAsList(File... files)
Creates file signature whereas order of the files remains unchanged.static FileSignature
signAsList(Iterable<File> files)
Creates file signature whereas order of the files remains unchanged.static FileSignature
signAsSet(File... files)
Creates file signature whereas order of the files remains unchanged.static FileSignature
signAsSet(Iterable<File> files)
Creates file signature insensitive to the order of the files.static String
subpath(String root, String child)
Asserts that child is a subpath of root.
-
-
-
Method Detail
-
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
-
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.
-
-