public class ReliableResource extends Object implements Resource, Serializable
ResourceCacheImpl
cache map.Constructor and Description |
---|
ReliableResource(String key,
String filePath,
MimeType mimeType,
String name,
Metacard metacard) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteArray()
Deprecated.
|
String |
getFilePath() |
InputStream |
getInputStream()
Gets the input stream.
|
String |
getKey()
Key is also filename of where file is stored.
|
long |
getLastTouchedMillis() |
Metacard |
getMetacard() |
MimeType |
getMimeType() |
String |
getMimeTypeValue()
|
String |
getName()
Gets the name of the Resource.
|
long |
getSize()
Get the size if known.
|
boolean |
hasProduct()
Returns true if the product file exists in the product cache directory.
|
void |
setLastTouchedMillis(long lastTouchedMillis) |
void |
setMimeType(MimeType mimeType) |
void |
setName(String name) |
void |
setSize(long size) |
String |
toString() |
public String getFilePath()
public String getKey()
@Deprecated public byte[] getByteArray() throws IOException
BinaryContent
InputStream
into a
byte
array.
Note that BinaryContent.getByteArray()
should be idempotent if BinaryContent.getInputStream()
has not
been initially invoked.
getByteArray
in interface BinaryContent
IOException
- if the stream can not be read into the arraypublic InputStream getInputStream()
Note that the binary from the InputStream
can only be accessed once. Thus, when
you call BinaryContent.getInputStream()
and retrieve the InputStream
object, it can
only be used once to extract the content. If it is necessary that the bytes of the
InputStream
object are needed again, use the BinaryContent.getByteArray()
method instead. Creates a new inputStream upon request.
getInputStream
in interface BinaryContent
null
if could not be retrieved.public boolean hasProduct()
public MimeType getMimeType()
getMimeType
in interface BinaryContent
InputStream
public void setMimeType(MimeType mimeType)
public String getMimeTypeValue()
BinaryContent
getMimeTypeValue
in interface BinaryContent
String
public long getSize()
BinaryContent
getSize
in interface BinaryContent
long
, -1 if unknownpublic void setSize(long size)
public String getName()
Resource
public void setName(String name)
public long getLastTouchedMillis()
public void setLastTouchedMillis(long lastTouchedMillis)
public Metacard getMetacard()
This work is licensed under a Creative Commons Attribution 4.0 International License.