Interface Artifact
- All Superinterfaces:
Dumpable
- All Known Subinterfaces:
ExportArtifact,ImportArtifact
- All Known Implementing Classes:
AbstractArtifact,DirectoryArtifact,HintArtifact,PropertyValueArtifact,SerializerArtifact
- primary (serialized) content
- additional serialized content
- binary attachments (eg. binary properties)
- directory representation
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.
-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the length of the serialized data if it's known without doing the actual serialization.Returns the content type of the serialized data ornullif the type is not known or cannot be determined.Returns the (repository) extension of this artifact. eg: ".jsp"Returns an input source to the contents of this artifact.Returns the input stream to the contents of this artifact.longReturns the last modified date or0if not known.Returns the relative path of this artifact in platform format including the extension. eg: "_cq_nodeType.cnd" or "en/.content.xml" and eventual intermediate extensions. eg: "image.png.dir/.content.xml"Returns the preferred access value for this artifact.Returns the relative (repository) path of this artifact in respect to it's parent node. eg: "myNodeType"Returns the serialization type of this artifact.getType()Returns the type of this artifact.voidspool(OutputStream out) Writes the content to the given output stream.
-
Method Details
-
getPlatformPath
String getPlatformPath()Returns the relative path of this artifact in platform format including the extension. eg: "_cq_nodeType.cnd" or "en/.content.xml" and eventual intermediate extensions. eg: "image.png.dir/.content.xml"- Returns:
- the relative platform path
-
getExtension
String getExtension()Returns the (repository) extension of this artifact. eg: ".jsp"- Returns:
- the (repository) extension of this artifact.
-
getRelativePath
String getRelativePath()Returns the relative (repository) path of this artifact in respect to it's parent node. eg: "myNodeType"- Returns:
- the final name
-
getType
ArtifactType getType()Returns the type of this artifact.- Returns:
- the type of this artifact.
-
getSerializationType
SerializationType getSerializationType()Returns the serialization type of this artifact.- Returns:
- the serialization type of this artifact.
-
getPreferredAccess
AccessType getPreferredAccess()Returns the preferred access value for this artifact.- Returns:
- the preferred access value.
-
getContentLength
long getContentLength()Returns the length of the serialized data if it's known without doing the actual serialization.- Returns:
- the length or
-1if the length cannot be determined.
-
getContentType
String getContentType()Returns the content type of the serialized data ornullif the type is not known or cannot be determined.- Returns:
- the content type or
null.
-
getLastModified
long getLastModified()Returns the last modified date or0if not known.- Returns:
- the last modified date or
0
-
spool
Writes the content to the given output stream. This is the preferred method to use for output-artifacts.The specified stream remains open after this method returns.
- Parameters:
out- the output stream to spool to- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
getInputStream
Returns the input stream to the contents of this artifact. This is the preferred method to use for input-artifacts.- Returns:
- a input stream to the contents of this artifact.
- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
getInputSource
Returns an input source to the contents of this artifact. This is also preferred forAccessType.STREAM.- Returns:
- an input source.
- Throws:
IOException- if an I/O error occurs.RepositoryException- of a repository error occurs.
-