@Properties(value={@Property(name="service.vendor",value="The Apache Software Foundation"),@Property(name="service.description",value="Apache Sling JCR Content Import Service")})
@Service(value=ContentImporter.class)
public class DefaultContentImporter
extends BaseImportLoader
implements JcrContentHelper, ContentImporter
DefaultContentImporter is the default implementation of the ContentImporter service providing the following functionality:
EXT_JAR, EXT_JCR_XML, EXT_JSON, EXT_XML, EXT_ZIP| 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 name,
InputStream contentStream,
ImportOptions importOptions,
ContentImportListener importListener)
Import content into the repository by parsing the provided
content stream.
|
disposepublic void importContent(javax.jcr.Node parent,
String name,
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. The file extension determines the content typecontentStream - 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)
JcrContentHelpergetMimeType in interface JcrContentHelpername - the name of the file to get the mimeType forCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.