Class PropertyValueArtifact
java.lang.Object
org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
org.apache.jackrabbit.vault.fs.impl.PropertyValueArtifact
- All Implemented Interfaces:
Artifact,Dumpable,ExportArtifact
Implements a artifact that is based on a property value.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyValueArtifact(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, int index, long lastModified) PropertyValueArtifact(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, long lastModified) -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<PropertyValueArtifact>create(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, long lastModified) Creates a collection ofPropertyValueArtifactfrom the given property.voiddetach()Detaches the value from the underlying property value.longReturns 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 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 underlying propertyReturns the serialization type of this artifact.Methods inherited from class org.apache.jackrabbit.vault.fs.impl.AbstractArtifact
dump, equals, getExtension, getPlatformPath, getRelativePath, getType, hashCode, setContentType, spool, 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
getExtension, getPlatformPath, getRelativePath, getType, spool
-
Constructor Details
-
PropertyValueArtifact
public PropertyValueArtifact(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, long lastModified) throws RepositoryException - Throws:
RepositoryException
-
PropertyValueArtifact
public PropertyValueArtifact(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, int index, long lastModified) throws RepositoryException - Throws:
RepositoryException
-
-
Method Details
-
create
public static Collection<PropertyValueArtifact> create(Artifact parent, String relPath, String ext, ArtifactType type, Property prop, long lastModified) throws RepositoryException Creates a collection ofPropertyValueArtifactfrom the given property. If the property is multivalued there will be an artifact created for each value with the value index appended to it's name.- Parameters:
parent- parent artifactrelPath- the base name for the artifact(s).ext- the extensiontype- the type for the artifact(s).prop- the property for the artifact(s).lastModified- the last modified date.- Returns:
- a collection of Artifacts.
- Throws:
RepositoryException- if an error occurs
-
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.STREAM
-
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
-
detach
Detaches the value from the underlying property value.- 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:
- a input source which systemId is the path of the underlying property
- 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.
-
getProperty
Returns the underlying property- Returns:
- the underlying property
-
getLastModified
public long getLastModified()Returns the last modified date or0if not known.- Specified by:
getLastModifiedin interfaceArtifact- Returns:
- the last modified date or
0
-
getContentType
Returns the content type of the serialized data ornullif the type is not known or cannot be determined.- Specified by:
getContentTypein interfaceArtifact- Overrides:
getContentTypein classAbstractArtifact- Returns:
- the content type or
null.
-