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 PostProcessPlugin s 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_TYPE
name
- name of the ProcessResource
, defaults to DEFAULT_NAME
public 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_TYPE
name
- name of the ProcessResource
, defaults to DEFAULT_NAME
size
- 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_TYPE
name
- name of the ProcessResource
, defaults to DEFAULT_NAME
size
- size of the ProcessResource
's , throws IllegalArgumentException
if less than -1qualifier
- fragment of the ProcessResource
's URI
, defaults to empty
stringpublic URI getUri()
ProcessResource
getUri
in interface ProcessResource
ProcessResource
public String getQualifier()
ProcessResource
ProcessResource
, 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 ProcessResource
ProcessResource
public String getName()
ProcessResource
getName
in interface ProcessResource
ProcessResource
public String getMimeType()
ProcessResource
ProcessResource
, e.g., image/nitf or
application/json;id=geojsongetMimeType
in interface ProcessResource
ProcessResource
public InputStream getInputStream() throws IOException
ProcessResource
ProcessResource
's actual data content.getInputStream
in interface ProcessResource
ProcessResource
's input streamIOException
- if the input stream is not availablepublic long getSize()
ProcessResource
ProcessResource
's input stream.getSize
in interface ProcessResource
ProcessResource.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()
ProcessResource
ProcessResource
has been modified or created by any of the PostProcessPlugin
s 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 ProcessResource
true
if modified, false
otherwisepublic void close()
ProcessResource
Look into having the ProcessResource implement InputStream
close
in interface ProcessResource
public void markAsModified()
This work is licensed under a Creative Commons Attribution 4.0 International License.