Package com.diffplug.spotless
Class FileSignature
- java.lang.Object
-
- com.diffplug.spotless.FileSignature
-
- All Implemented Interfaces:
java.io.Serializable
public final class FileSignature extends java.lang.Object implements java.io.SerializableComputes 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 java.util.Collection<java.io.File>files()Returns all of the files in this signature, throwing an exception if there are more or less than 1 file.java.io.FilegetOnlyFile()Returns the only file in this signature, throwing an exception if there are more or less than 1 file.static booleanmachineIsWin()Returns true if this JVM is running on a windows machine.static java.lang.StringpathNativeToUnix(java.lang.String pathNative)Transforms a native path to a unix one.static java.lang.StringpathUnixToNative(java.lang.String pathUnix)Transforms a unix path to a native one.static FileSignaturesignAsList(java.io.File... files)Creates file signature whereas order of the files remains unchanged.static FileSignaturesignAsList(java.lang.Iterable<java.io.File> files)Creates file signature whereas order of the files remains unchanged.static FileSignaturesignAsSet(java.io.File... files)Creates file signature whereas order of the files remains unchanged.static FileSignaturesignAsSet(java.lang.Iterable<java.io.File> files)Creates file signature insensitive to the order of the files.static java.lang.Stringsubpath(java.lang.String root, java.lang.String child)Asserts that child is a subpath of root.
-
-
-
Method Detail
-
signAsList
public static FileSignature signAsList(java.io.File... files) throws java.io.IOException
Creates file signature whereas order of the files remains unchanged.- Throws:
java.io.IOException
-
signAsList
public static FileSignature signAsList(java.lang.Iterable<java.io.File> files) throws java.io.IOException
Creates file signature whereas order of the files remains unchanged.- Throws:
java.io.IOException
-
signAsSet
public static FileSignature signAsSet(java.io.File... files) throws java.io.IOException
Creates file signature whereas order of the files remains unchanged.- Throws:
java.io.IOException
-
signAsSet
public static FileSignature signAsSet(java.lang.Iterable<java.io.File> files) throws java.io.IOException
Creates file signature insensitive to the order of the files.- Throws:
java.io.IOException
-
files
public java.util.Collection<java.io.File> files()
Returns all of the files in this signature, throwing an exception if there are more or less than 1 file.
-
getOnlyFile
public java.io.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 java.lang.String pathNativeToUnix(java.lang.String pathNative)
Transforms a native path to a unix one.
-
pathUnixToNative
public static java.lang.String pathUnixToNative(java.lang.String pathUnix)
Transforms a unix path to a native one.
-
subpath
public static java.lang.String subpath(java.lang.String root, java.lang.String child)Asserts that child is a subpath of root. and returns the subpath.
-
-