@Service(value=ContentImporter.class) @Property(name="service.description", value="Apache Sling JCR Content Import Service") @Reference(name="contentReaderWhiteboard", cardinality=MANDATORY_UNARY, policy=DYNAMIC, referenceInterface=ContentReaderWhiteboard.class) public class DefaultContentImporter extends BaseImportLoader implements ContentHelper, ContentImporter
DefaultContentImporter is the default implementation of the ContentImporter service providing the following functionality:
EXT_JCR_XML| Constructor and Description |
|---|
DefaultContentImporter() |
| Modifier and Type | Method and Description |
|---|---|
String |
getMimeType(String name)
Returns the MIME type from the MimeTypeService for the given name
|
void |
importContent(javax.jcr.Node parent,
String filename,
InputStream contentStream,
ImportOptions importOptions,
ContentImportListener importListener)
Import content into the repository by parsing the provided content stream.
|
void |
importContent(javax.jcr.Node parent,
String name,
String contentType,
InputStream contentStream,
ImportOptions importOptions,
ContentImportListener importListener)
Import content into the repository by parsing the provided content stream.
|
bindContentReaderWhiteboard, getContentReader, getContentReader, getContentReaderExtension, getContentReaders, toPlainName, unbindContentReaderWhiteboardimportJcrXmlpublic void importContent(javax.jcr.Node parent,
String filename,
InputStream contentStream,
ImportOptions importOptions,
ContentImportListener importListener)
throws javax.jcr.RepositoryException,
IOException
ContentImporterimportContent in interface ContentImporterparent - the root node for the imported contentfilename - the name of the imported content. Becomes the node name (without extension). The file extension determines the content type.contentStream - the content stream to be importedimportOptions - (optional) additional options to control the importimportListener - (optional) listener to receive callbacks for each change in the importjavax.jcr.RepositoryExceptionIOExceptionpublic void importContent(javax.jcr.Node parent,
String name,
String contentType,
InputStream contentStream,
ImportOptions importOptions,
ContentImportListener importListener)
throws javax.jcr.RepositoryException,
IOException
ContentImporterimportContent in interface ContentImporterparent - the root node for the imported contentname - the name of the imported content. Becomes the node name. If null, imports in PARENT_NODE import mode.contentType - the content type of the content streamcontentStream - the content stream to be importedimportOptions - (optional) additional options to control the importimportListener - (optional) listener to receive callbacks for each change in the importjavax.jcr.RepositoryExceptionIOExceptionpublic String getMimeType(String name)
ContentHelpergetMimeType in interface ContentHelpername - the name of the file to get the mimeType forCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.