Package com.diffplug.blowdryer
Class Blowdryer
- java.lang.Object
-
- com.diffplug.blowdryer.Blowdryer
-
public class Blowdryer extends java.lang.Object
Public static methods which retrieve resources as determined byBlowdryerSetup
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Blowdryer.WithProject
Alias forBlowdryer
which fills in the `project` field of the `proj()` methods automatically.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.File
file(java.lang.String resourcePath)
Returns the given resource as a File (as configured byBlowdryerSetup
.static java.io.File
immutableUrl(java.lang.String url)
Downloads the given url to a local file in the system temporary directory.static java.io.File
immutableUrl(java.lang.String url, java.lang.String requiredSuffix)
Downloads the given url to a local file in the system temporary directory.static <T> T
proj(Project project, java.lang.Class<T> clazz, java.lang.String key, java.lang.String descForError)
Reads a property from the project, and throws "Undefined 'key': descForError" if it is missing, or "Wrong type 'key': descForError - expected java.io.File but was java.io.String"static java.lang.String
proj(Project project, java.lang.String key, java.lang.String descForError)
Reads a property from the project, and throws "Undefined 'key': descForError" if it is missing.static <T> T
projOptional(Project project, java.lang.Class<T> clazz, java.lang.String key, java.lang.String descForError)
Reads a property from the project, returns null if it is not present.static java.lang.String
projOptional(Project project, java.lang.String key, java.lang.String descForError)
Alias forprojOptional(Project, String, String)
withString.class
.static java.lang.String
prop(java.lang.String propFile, java.lang.String key)
Returns the key from the given propFile (adds .properties extension automatically).
-
-
-
Method Detail
-
immutableUrl
public static java.io.File immutableUrl(java.lang.String url)
Downloads the given url to a local file in the system temporary directory. It will only be downloaded once, system-wide, and it will not be checked for updates. This is appropriate only for immutable URLs, such as specific hashes from Git.
-
immutableUrl
public static java.io.File immutableUrl(java.lang.String url, @Nullable java.lang.String requiredSuffix)
Downloads the given url to a local file in the system temporary directory. It will only be downloaded once, system-wide, and it will not be checked for updates. This is appropriate only for immutable URLs, such as specific hashes from Git. If requiredSuffix is non-null, it is guaranteed that the returned filename will end with that string.
-
file
public static java.io.File file(java.lang.String resourcePath)
Returns the given resource as a File (as configured byBlowdryerSetup
.
-
prop
public static java.lang.String prop(java.lang.String propFile, java.lang.String key) throws java.io.IOException
Returns the key from the given propFile (adds .properties extension automatically).- Throws:
java.io.IOException
-
proj
public static java.lang.String proj(Project project, java.lang.String key, java.lang.String descForError)
Reads a property from the project, and throws "Undefined 'key': descForError" if it is missing. Requires the property value to be a String.
-
proj
public static <T> T proj(Project project, java.lang.Class<T> clazz, java.lang.String key, java.lang.String descForError)
Reads a property from the project, and throws "Undefined 'key': descForError" if it is missing, or "Wrong type 'key': descForError - expected java.io.File but was java.io.String"
-
projOptional
@Nullable public static <T> T projOptional(Project project, java.lang.Class<T> clazz, java.lang.String key, java.lang.String descForError)
Reads a property from the project, returns null if it is not present.
-
projOptional
@Nullable public static java.lang.String projOptional(Project project, java.lang.String key, java.lang.String descForError)
Alias forprojOptional(Project, String, String)
withString.class
.
-
-