public class SerializerArtifact extends AbstractArtifact implements ExportArtifact
AccessType.SPOOL
Constructor and Description |
---|
SerializerArtifact(Artifact parent,
java.lang.String name,
java.lang.String ext,
ArtifactType type,
Serializer serializer,
long lastModified)
Constructs a new artifact that is based on a content serializer.
|
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. |
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. |
AccessType |
getPreferredAccess()
Returns the preferred access value for this artifact.
|
SerializationType |
getSerializationType()
Returns the serialization type of this artifact.
|
void |
spool(java.io.OutputStream out)
Writes the content to the given output stream and closes it afterwards.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExtension, getPlatformPath, getRelativePath, getType
public SerializerArtifact(Artifact parent, java.lang.String name, java.lang.String ext, ArtifactType type, Serializer serializer, long lastModified)
parent
- the parent artifactname
- the name of the artifactext
- the extension of the artifacttype
- the type of the artifactserializer
- the serializer to use for the contentlastModified
- the last modified datejava.lang.IllegalArgumentException
- if the type is not suitable.public AccessType getPreferredAccess()
getPreferredAccess
in interface Artifact
AccessType.SPOOL
public SerializationType getSerializationType()
getSerializationType
in interface Artifact
public void spool(java.io.OutputStream out) throws java.io.IOException, RepositoryException
public java.io.InputStream getInputStream() throws java.io.IOException, RepositoryException
getInputStream
in interface Artifact
java.io.IOException
- if an I/O error occursRepositoryException
- if a repository error occurspublic VaultInputSource getInputSource() throws java.io.IOException, RepositoryException
AccessType.STREAM
.getInputSource
in interface Artifact
java.io.IOException
- if an I/O error occurs.RepositoryException
- of a repository error occurs.public java.lang.String getContentType()
null
if
the type is not known or cannot be determined.getContentType
in interface Artifact
null
.public long getContentLength()
getContentLength
in interface Artifact
-1
if the length cannot be determined.public long getLastModified()
0
if not known.getLastModified
in interface Artifact
0
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"