Class StrumpfResolver

    • Constructor Detail

      • StrumpfResolver

        public StrumpfResolver()
    • Method Detail

      • priority

        public int priority()
        Description copied from interface: Resolver
        Priority of this resolver. 0 is highest priority (check first), larger values are lower priority (check last)
        Specified by:
        priority in interface Resolver
      • exists

        public boolean exists​(@NonNull
                              @NonNull String resourcePath)
        Description copied from interface: Resolver
        Determine if the specified file resource can be resolved by Resolver.asFile(String) and Resolver.asStream(String)
        Specified by:
        exists in interface Resolver
        Parameters:
        resourcePath - Path of the resource to be resolved
        Returns:
        True if this resolver is able to resolve the resource file - i.e., whether it is a valid path and exists
      • directoryExists

        public boolean directoryExists​(String dirPath)
        Description copied from interface: Resolver
        Determine if the specified directory resource can be resolved by Resolver.copyDirectory(String, File)
        Specified by:
        directoryExists in interface Resolver
        Parameters:
        dirPath - Path of the directory resource to be resolved
        Returns:
        True if this resolver is able to resolve the directory - i.e., whether it is a valid path and exists
      • asFile

        public File asFile​(String resourcePath)
        Description copied from interface: Resolver
        Get the specified resources as a standard local file. Note that the resource must exist as determined by Resolver.exists(String)
        Specified by:
        asFile in interface Resolver
        Parameters:
        resourcePath - Path of the resource.
        Returns:
        The local file version of the resource
      • asStream

        public InputStream asStream​(String resourcePath)
        Description copied from interface: Resolver
        Get the specified resources as an input stream. Note that the resource must exist as determined by Resolver.exists(String)
        Specified by:
        asStream in interface Resolver
        Parameters:
        resourcePath - Path of the resource.
        Returns:
        The resource as an input stream
      • copyDirectory

        public void copyDirectory​(String dirPath,
                                  File destinationDir)
        Description copied from interface: Resolver
        Copy the directory resource (recursively) to the specified destination directory
        Specified by:
        copyDirectory in interface Resolver
        Parameters:
        dirPath - Path of the resource directory to resolve
        destinationDir - Where the files should be copied to
      • normalizePath

        public String normalizePath​(@NonNull
                                    @NonNull String path)
        Description copied from interface: Resolver
        Normalize the path that may be a resource reference. For example: "someDir/myFile.zip.resource_reference" --> "someDir/myFile.zip" Returns null if the file cannot be resolved. If the file is not a reference, the original path is returned
        Specified by:
        normalizePath in interface Resolver
      • assertExists

        protected void assertExists​(String resourcePath)