Class HintArtifact
java.lang.Object
org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
org.apache.jackrabbit.vault.fs.impl.HintArtifact
- All Implemented Interfaces:
Artifact,Dumpable,ExportArtifact,ImportArtifact
Implements a generic hint artifact.
-
Constructor Summary
ConstructorsConstructorDescriptionHintArtifact(String name) Constructs a new directory type artifact with the given repository name.HintArtifact(String name, String extension) Constructs a new directory type artifact with the given repository name and extension -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the length of the serialized data if it's known without doing the actual serialization.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 preferred access value for this artifact.Returns the serialization type of this artifact.voidspool(OutputStream out) Writes the content to the given output stream.Methods inherited from class org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
dump, equals, getContentType, getExtension, getPlatformPath, getRelativePath, getType, hashCode, setContentType, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.vault.fs.api.Artifact
getContentType, getExtension, getPlatformPath, getRelativePath, getType
-
Constructor Details
-
HintArtifact
Constructs a new directory type artifact with the given repository name.- Parameters:
name- the repository name for this artifact.
-
HintArtifact
Constructs a new directory type artifact with the given repository name and extension- Parameters:
name- the repository name for this artifact.extension- the extension for this artifact
-
-
Method Details
-
getSerializationType
Returns the serialization type of this artifact.- Specified by:
getSerializationTypein interfaceArtifact- Returns:
- the serialization type of this artifact.
-
getPreferredAccess
Returns the preferred access value for this artifact.- Specified by:
getPreferredAccessin interfaceArtifact- Returns:
- always
AccessType.NONE
-
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. Provides a generic spool mechanism from the
Artifact.getInputStream()to the provided output stream.- Specified by:
spoolin interfaceArtifact- Overrides:
spoolin classAbstractArtifact- 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.- Specified by:
getInputStreamin interfaceArtifact- 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.- Specified by:
getInputSourcein interfaceArtifact- Returns:
- an input source.
- Throws:
IOException- if an I/O error occurs.RepositoryException- of a repository error occurs.
-
getContentLength
public long getContentLength()Returns the length of the serialized data if it's known without doing the actual serialization.- Specified by:
getContentLengthin interfaceArtifact- Returns:
- the length or
-1if the length cannot be determined.
-
getLastModified
public long getLastModified()Returns the last modified date or0if not known.- Specified by:
getLastModifiedin interfaceArtifact- Returns:
- the last modified date or
0
-