saker.build Documentation TaskDoc JavaDoc Packages
public class SakerDirectoryClassLoaderDataFinder implements ClassLoaderDataFinder
ClassLoaderDataFinder implementation that is backed by a SakerDirectory.

Any resource requests will be resolved against the underlying directory.

This data finder should only be used when a build is running. It should not be used or cached during subsequent builds or task invocations, as the underlying directories may be invalidated. It should not be shared between different tasks.

Fields
protected final SakerDirectory
The directory which is used for finding resources.
protected final TaskExecutionUtilities
The task utilities for the task.
Constructors
public
Creates a new instance for the given directory.
Methods
public ByteArrayRegion
Gets the bytes of the class denoted by the given binary name.
public Supplier<ByteSource>
Gets a supplier for an existing resource stream specified by the given name.
public ByteSource
Opens a stream to the resource specified by the given name.
public String
Returns a string representation of the object.
protected final SakerDirectory directory
The directory which is used for finding resources.
The task utilities for the task.
Creates a new instance for the given directory.
taskUtilsThe task utilities that the data finder can use.
directoryThe directory to use for resource requests.
NullPointerExceptionIf any of the arguments are null.
Overridden from: ClassLoaderDataFinder
Gets the bytes of the class denoted by the given binary name.
classnameThe class name.
The bytes of the class or null if not found.
Overridden from: ClassLoaderDataFinder
Gets a supplier for an existing resource stream specified by the given name.

The name is a slash ('/') separated path to the resource to be found.

The opened stream by the returned supplier should be closed for each returned stream.

The returned supplier can still return null, if there was opening error in the stream.

nameThe name of the resource.
A supplier which opens a stream to the resource bytes or null if the resource is not found.
Overridden from: ClassLoaderDataFinder
Opens a stream to the resource specified by the given name.

The name is a slash ('/') separated path to the resource to be found.

The returned stream should be closed by the caller.

nameThe name of the resource.
The opened stream to the resource, or null if not found.
public String toString()
Overridden from: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
a string representation of the object.