public abstract class BundleResourceBase extends java.lang.Object implements BundleResource, java.io.Serializable
BundleResource implementations.| Constructor and Description |
|---|
BundleResourceBase(java.lang.String displayName,
java.lang.String contentType,
java.lang.String format)
Base constructor for creating a new bundle resource.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getContentType()
Get the content type for this resource.
|
java.lang.String |
getDisplayName()
Get the display name for this resource.
|
java.util.Optional<java.lang.String> |
getFileFormat()
Get the file format for this resource.
|
java.util.Optional<java.io.InputStream> |
getInputStream()
Get an
InputStream for this resource, or Optional.empty. |
java.util.Optional<IOPath> |
getIOPath()
Get the
IOPath backing this resource, or Optional.empty. |
java.util.Optional<java.io.OutputStream> |
getOutputStream()
Get an
OutputStream for this resource, or Optional.empty. |
java.util.Optional<SeekableStream> |
getSeekableStream()
Get a
SeekableStream for this resource, or Optional.empty. |
int |
hashCode() |
boolean |
hasInputType()
Return true if is this resource is backed by a type that can be used for input.
|
boolean |
hasOutputType()
Return true if this resource is backed by a type that can be used for output.
|
boolean |
hasSeekableStream()
Returns true if this resource can be rendered as a
SeekableStream. |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSignatureStreampublic BundleResourceBase(java.lang.String displayName,
java.lang.String contentType,
java.lang.String format)
displayName - A user-recognizable name for this resource. Used for error messages. May not be null or
0 length.contentType - The content type for this resource. Can be any string, but it must be unique within a
given bundle. May not be null or zero length.format - The (optional) format for this resource. Can be any string, i.e, "BAM" for
a resource with content type "READS". Predefined format strings are defined
in BundleResourceType.public java.lang.String getDisplayName()
BundleResourcegetDisplayName in interface BundleResourcepublic java.lang.String getContentType()
BundleResourcegetContentType in interface BundleResourcepublic java.util.Optional<java.lang.String> getFileFormat()
BundleResourcegetFileFormat in interface BundleResourcepublic java.util.Optional<IOPath> getIOPath()
BundleResourceIOPath backing this resource, or Optional.empty.getIOPath in interface BundleResourceIOPath backing this resource, or Optional.empty if the resource has no backing
IOPathpublic java.util.Optional<java.io.InputStream> getInputStream()
BundleResourceInputStream for this resource, or Optional.empty.getInputStream in interface BundleResourceInputStream for this resource, or Optional.empty if BundleResource.hasInputType() is false for this resource.
The stream returned by this method may be buffered or use read-ahead, which may not be
suitable for applications such as index creation that need control over the position of the
underlying stream.public java.util.Optional<java.io.OutputStream> getOutputStream()
BundleResourceOutputStream for this resource, or Optional.empty.getOutputStream in interface BundleResourceOutputStream for this resource, or Optional.empty if BundleResource.hasOutputType() is false for this resourcepublic java.util.Optional<SeekableStream> getSeekableStream()
BundleResourceSeekableStream for this resource, or Optional.empty.getSeekableStream in interface BundleResourceSeekableStream for this resource, or Optional.empty if this is not an input
type (see BundleResource.hasInputType()), or is an input type for which no SeekableStream
can be obtained (see BundleResource.hasSeekableStream()).public boolean hasSeekableStream()
BundleResourceSeekableStream.hasSeekableStream in interface BundleResourceSeekableStream (see BundleResource.getSeekableStream())public boolean hasInputType()
BundleResourceInputStreamResource, can be used for input but not for output (see
BundleResource.hasOutputType(). Others, such as OutputStreamResource, can be used for output but not
for input. Some resource types may be suitable for both (for example see IOPathResource).
The determination is based only on the type of the resource, and does not imply a guarantee about whether the resource type is actually readable.
hasInputType in interface BundleResourcepublic boolean hasOutputType()
BundleResourceInputStreamResource, can be used for input but not for output (see
BundleResource.hasOutputType(). Others, such as OutputStreamResource, can be used for output but
not for input. Some resource types may be suitable for both (for example see IOPathResource).
The determination is based only on the type of the resource, and does not imply a guarantee about whether the resource is actually writeable.
hasOutputType in interface BundleResourcepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object