Class Blowdryer


  • public class Blowdryer
    extends java.lang.Object
    Public static methods which retrieve resources as determined by BlowdryerSetup.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Blowdryer.WithProject
      Alias for Blowdryer 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 by BlowdryerSetup.
      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 for projOptional(Project, String, String) with String.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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 by BlowdryerSetup.
      • 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.