public interface Artifact extends Dumpable
Depending on the type of the artifact and of it's source different access
methods for it's content are preferred:
If AccessType.NONE
is set, no content is available. this is
the case for ArtifactType.DIRECTORY
artifacts.
If AccessType.SPOOL
is set then clients should use the
spool(OutputStream)
method to retrieve the content. this is mostly
the case for output-artifacts that have serialized content.
Tree.If AccessType.STREAM
is set then clients should use the
getInputStream()
method in to retrieve the content. this is mostly
the case for input-artifacts or for ArtifactType.BINARY
artifacts.
Each artifact contains a (repository) name and a possible extension. The name and the extension must be preserved after a export/import roundtrip.
Modifier and Type | Method and Description |
---|---|
long |
getContentLength()
Returns the length of the serialized data if it's known without doing the
actual serialization.
|
java.lang.String |
getContentType()
Returns the content type of the serialized data or
null if
the type is not known or cannot be determined. |
java.lang.String |
getExtension()
Returns the (repository) extension of this artifact.
|
VaultInputSource |
getInputSource()
Returns an input source to the contents of this artifact.
|
java.io.InputStream |
getInputStream()
Returns the input stream to the contents of this artifact.
|
long |
getLastModified()
Returns the last modified date or
0 if not known. |
java.lang.String |
getPlatformPath()
Returns the relative path of this artifact in platform format including
the extension.
|
AccessType |
getPreferredAccess()
Returns the preferred access value for this artifact.
|
java.lang.String |
getRelativePath()
Returns the relative (repository) path of this artifact in respect to
it's parent node.
|
SerializationType |
getSerializationType()
Returns the serialization type of this artifact.
|
ArtifactType |
getType()
Returns the type of this artifact.
|
void |
spool(java.io.OutputStream out)
Writes the content to the given output stream and closes it afterwards.
|
java.lang.String getPlatformPath()
java.lang.String getExtension()
java.lang.String getRelativePath()
ArtifactType getType()
SerializationType getSerializationType()
AccessType getPreferredAccess()
long getContentLength()
-1
if the length cannot be determined.java.lang.String getContentType()
null
if
the type is not known or cannot be determined.null
.long getLastModified()
0
if not known.0
void spool(java.io.OutputStream out) throws java.io.IOException, RepositoryException
out
- the output stream to spool tojava.io.IOException
- if an I/O error occursRepositoryException
- if a repository error occursjava.io.InputStream getInputStream() throws java.io.IOException, RepositoryException
java.io.IOException
- if an I/O error occursRepositoryException
- if a repository error occursVaultInputSource getInputSource() throws java.io.IOException, RepositoryException
AccessType.STREAM
.java.io.IOException
- if an I/O error occurs.RepositoryException
- of a repository error occurs."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"