public class SerializerArtifact extends Object implements ExportArtifact
AccessType.SPOOL
Constructor and Description |
---|
SerializerArtifact(Artifact parent,
String name,
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 |
---|---|
void |
dump(DumpContext ctx,
boolean isLast)
Dumps some human readable information using the given context.
|
long |
getContentLength()
Returns the length of the serialized data if it's known without doing the
actual serialization.
|
String |
getContentType()
Returns the content type of the serialized data or
null if
the type is not known or cannot be determined. |
String |
getExtension()
Returns the (repository) extension of this artifact.
|
VaultInputSource |
getInputSource()
Returns an input source to the contents of this artifact.
|
InputStream |
getInputStream()
Returns the input stream to the contents of this artifact.
|
long |
getLastModified()
Returns the last modified date or
0 if not known. |
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.
|
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(OutputStream out)
Writes the content to the given output stream and closes it afterwards.
|
public SerializerArtifact(Artifact parent, String name, 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 dateIllegalArgumentException
- 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(OutputStream out) throws IOException, RepositoryException
spool
in interface Artifact
out
- the output stream to spool toIOException
- if an I/O error occursRepositoryException
- if a repository error occurspublic InputStream getInputStream() throws IOException, RepositoryException
getInputStream
in interface Artifact
IOException
- if an I/O error occursRepositoryException
- if a repository error occurspublic VaultInputSource getInputSource() throws IOException, RepositoryException
AccessType.STREAM
.getInputSource
in interface Artifact
IOException
- if an I/O error occurs.RepositoryException
- of a repository error occurs.public 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
public String getPlatformPath()
Artifact
getPlatformPath
in interface Artifact
public String getExtension()
Artifact
getExtension
in interface Artifact
public String getRelativePath()
Artifact
getRelativePath
in interface Artifact
public ArtifactType getType()
Artifact
public void dump(DumpContext ctx, boolean isLast)
Dumpable
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"