Package com.adobe.aemfd.docmanager
Class DocumentFactory
- java.lang.Object
-
- com.adobe.aemfd.docmanager.DocumentFactory
-
public abstract class DocumentFactory extends java.lang.Object
The DocumentFactory class is an abstraction which is used to create Document objects from various sources of content (URLs, JCR nodes, etc.)
-
-
Constructor Summary
Constructors Constructor Description DocumentFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DocumentFactory
getInstance()
Returns the DocumentFactoryInstance from the factoryabstract Document
newDocument(byte[] data)
Creates a Document from a byte-array.abstract Document
newDocument(java.io.File file)
Creates a Document from a file.abstract Document
newDocument(java.io.File file, boolean ownFile)
Creates a Document from a file.abstract Document
newDocument(java.io.InputStream is)
Creates a Document from an input-stream.abstract Document
newDocument(java.lang.String jcrPath)
Creates a Document from the path of a JCR node.abstract Document
newDocument(java.lang.String jcrPath, ResourceResolver resolver)
Creates a Document from the path of a JCR node.abstract Document
newDocument(java.lang.String jcrPath, ResourceResolver resolver, boolean manageResolver)
Creates a Document from the path of a JCR node.abstract Document
newDocument(java.net.URL url)
Creates a Document from a URL.static void
setInstance(DocumentFactory instance)
Sets the DocumentFactory implementation in the factory which can be used for the creation of Document objects
-
-
-
Method Detail
-
setInstance
public static void setInstance(DocumentFactory instance)
Sets the DocumentFactory implementation in the factory which can be used for the creation of Document objects- Parameters:
instance
-
-
getInstance
public static DocumentFactory getInstance()
Returns the DocumentFactoryInstance from the factory- Returns:
- DocumentFactory instance
-
newDocument
public abstract Document newDocument(byte[] data)
Creates a Document from a byte-array.- Parameters:
data
- The byte-array serving as the content-source for the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.io.File file)
Creates a Document from a file. Equivalent tonewDocument(file, false)
. SeenewDocument(java.io.File, boolean)
for more details.- Parameters:
file
- The file serving as the content-source for the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.io.File file, boolean ownFile)
Creates a Document from a file. The Document also starts "managing" the file if the ownFile parameter is true,- Parameters:
file
- The file serving as the content-source for the Document.ownFile
- Whether the file is henceforth to be managed by the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.net.URL url)
Creates a Document from a URL.- Parameters:
url
- The URL serving as the content-source for the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.io.InputStream is)
Creates a Document from an input-stream.- Parameters:
is
- The input-stream serving as the content-source for the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.lang.String jcrPath)
Creates a Document from the path of a JCR node.- Parameters:
jcrPath
- The path of the JCR-node serving as the content-source for the Document.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.lang.String jcrPath, ResourceResolver resolver)
Creates a Document from the path of a JCR node. The Document uses the provided resource-resolver for resolving the given path. Equivalent tonewDocument(jcrPath, resolver, false)
. SeenewDocument(String, org.apache.sling.api.resource.ResourceResolver, boolean)
for more details.- Parameters:
jcrPath
- The path of the JCR-node serving as the content-source for the Document.resolver
- The resource-resolver to be used for resolving the given path.- Returns:
- Document
-
newDocument
public abstract Document newDocument(java.lang.String jcrPath, ResourceResolver resolver, boolean manageResolver)
Creates a Document from the path of a JCR node. The Document uses the provided resource-resolver for resolving the given path. The Document also starts "managing" the resolver if the manageResolver parameter is true- Parameters:
jcrPath
- The path of the JCR-node serving as the content-source for the Document.resolver
- The resource-resolver to be used for resolving the given path.manageResolver
- Whether the resource-resolver is henceforth to be managed by the Document.- Returns:
- Document
-
-