public class ProcessResourceImpl extends Object implements ProcessResource
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_SCHEME |
static String |
DEFAULT_MIME_TYPE |
static String |
DEFAULT_NAME |
UNKNOWN_SIZE| Constructor and Description |
|---|
ProcessResourceImpl(String metacardId,
InputStream inputStream,
String mimeType,
String name)
Creates a
ProcessResource with ProcessResource.isModified() set to true
and ProcessResource.getQualifier() set to empty string. |
ProcessResourceImpl(String metacardId,
InputStream inputStream,
String mimeType,
String name,
long size)
Creates a
ProcessResource with ProcessResource.getQualifier() set to empty
string. |
ProcessResourceImpl(String metacardId,
InputStream inputStream,
String mimeType,
String name,
long size,
String qualifier)
Creates a new
ProcessResource. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This is used to close the input stream.
|
InputStream |
getInputStream()
Return the input stream containing the
ProcessResource's actual data content. |
String |
getMimeType()
Return the mime type raw data for the
ProcessResource, e.g., image/nitf or
application/json;id=geojson |
String |
getName()
A human friendly readable name.
|
String |
getQualifier()
An optional field to provide additional information about a
ProcessResource, that if
present, indicates that this ProcessResource is derived from another Resource. |
long |
getSize()
Return the total number of bytes in the
ProcessResource's input stream. |
URI |
getUri()
Gets a URI that represents the resource in the catalog.
|
boolean |
isModified()
Determines if the
ProcessResource has been modified or created by any of the PostProcessPlugins during processing by the ProcessingFramework. |
void |
markAsModified() |
public static final String CONTENT_SCHEME
public static final String DEFAULT_NAME
public static final String DEFAULT_MIME_TYPE
public ProcessResourceImpl(String metacardId, InputStream inputStream, @Nullable String mimeType, @Nullable String name)
ProcessResource with ProcessResource.isModified() set to true
and ProcessResource.getQualifier() set to empty string.metacardId - schema specific part of URI, throws IllegalArgumentException
if empty or nullinputStream - InputStream of the ProcessResource, can be nullmimeType - mime type of the ProcessResource, defaults to DEFAULT_MIME_TYPEname - name of the ProcessResource, defaults to DEFAULT_NAMEpublic ProcessResourceImpl(String metacardId, InputStream inputStream, @Nullable String mimeType, @Nullable String name, long size)
ProcessResource with ProcessResource.getQualifier() set to empty
string.metacardId - schema specific part of URI, throws IllegalArgumentException
if empty or nullinputStream - InputStream of the ProcessResource, can be nullmimeType - mime type of the ProcessResource, defaults to DEFAULT_MIME_TYPEname - name of the ProcessResource, defaults to DEFAULT_NAMEsize - size of the ProcessResource's , throws IllegalArgumentException if less than -1public ProcessResourceImpl(String metacardId, InputStream inputStream, String mimeType, @Nullable String name, long size, @Nullable String qualifier)
ProcessResource.metacardId - schema specific part of URI, throws IllegalArgumentException
if empty or nullinputStream - InputStream of the ProcessResource, can be nullmimeType - mime type of the ProcessResource, defaults to DEFAULT_MIME_TYPEname - name of the ProcessResource, defaults to DEFAULT_NAMEsize - size of the ProcessResource's , throws IllegalArgumentException if less than -1qualifier - fragment of the ProcessResource's URI, defaults to empty
stringpublic URI getUri()
ProcessResourcegetUri in interface ProcessResourceProcessResourcepublic String getQualifier()
ProcessResourceProcessResource, that if
present, indicates that this ProcessResource is derived from another Resource. The parent content of this ProcessResource is this
ProcessResource's URI without the qualifier.getQualifier in interface ProcessResourceProcessResourcepublic String getName()
ProcessResourcegetName in interface ProcessResourceProcessResourcepublic String getMimeType()
ProcessResourceProcessResource, e.g., image/nitf or
application/json;id=geojsongetMimeType in interface ProcessResourceProcessResourcepublic InputStream getInputStream() throws IOException
ProcessResourceProcessResource's actual data content.getInputStream in interface ProcessResourceProcessResource's input streamIOException - if the input stream is not availablepublic long getSize()
ProcessResourceProcessResource's input stream.getSize in interface ProcessResourceProcessResource.UNKNOWN_SIZE if the total number of bytes is unknown or not applicable (e.g., in the case
of a live stream)public boolean isModified()
ProcessResourceProcessResource has been modified or created by any of the PostProcessPlugins during processing by the ProcessingFramework. This is used to
determine whether or not a UpdateStorageRequest for this
ProcessResource needs to be made back to the CatalogFramework.isModified in interface ProcessResourcetrue if modified, false otherwisepublic void close()
ProcessResourceLook into having the ProcessResource implement InputStream
close in interface ProcessResourcepublic void markAsModified()
This work is licensed under a Creative Commons Attribution 4.0 International License.