Package is.galia.source
Package for sources, which locate and provide uniform access to source images.
A source translates an identifier to an image locator, such as a pathname, in the particular type of underlying storage it is written to interface with. It can then check whether the underlying image object exists and is accessible, and if so, provide access to it to other application components. The rest of of the application does not need to know where an image resides, or how to access it natively—it can simply ask the source it has access to.
Writing Custom Sources
Sources must implement Source
. Inheriting from AbstractSource
will get you a
couple of free method implementations.
Custom sources are auto-detected using ServiceLoader
. Their JAR must include a file named Source
inside
resources/META-INF/services containing the fully qualified class name of
the implementation. Also, any references to the implementation from the
configuration file or delegate must use the fully qualified class name.
-
ClassDescriptionInfers a
Format
from some kind of information.Infers a format based on anIdentifier
.Infers a format based on some kind of name, such as a filename or object key.Locates, provides access to, and infers the format of a source image.Used to obtain an instance of aSource
defined in the configuration, or returned by a delegate method.How sources are chosen bySourceFactory.newSource(java.lang.String)
.