org.apache.sling.jcr.contentloader.internal
Class DefaultContentImporter

java.lang.Object
  extended by org.apache.sling.jcr.contentloader.internal.BaseImportLoader
      extended by org.apache.sling.jcr.contentloader.internal.DefaultContentImporter
All Implemented Interfaces:
ContentImporter, JcrContentHelper

public class DefaultContentImporter
extends BaseImportLoader
implements JcrContentHelper, ContentImporter

The DefaultContentImporter is the default implementation of the ContentImporter service providing the following functionality:


Field Summary
 
Fields inherited from class org.apache.sling.jcr.contentloader.internal.BaseImportLoader
EXT_JAR, EXT_JCR_XML, EXT_JSON, EXT_XML, EXT_ZIP
 
Constructor Summary
DefaultContentImporter()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
          Activates this component, called by SCR before registering as a service
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
          Deativates this component, called by SCR to take out of service
 String digestPassword(String pwd)
          Digest the given password using the configured digest algorithm
 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.
 
Methods inherited from class org.apache.sling.jcr.contentloader.internal.BaseImportLoader
dispose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContentImporter

public DefaultContentImporter()
Method Detail

importContent

public void importContent(javax.jcr.Node parent,
                          String name,
                          InputStream contentStream,
                          ImportOptions importOptions,
                          ContentImportListener importListener)
                   throws javax.jcr.RepositoryException,
                          IOException
Description copied from interface: ContentImporter
Import content into the repository by parsing the provided content stream.

Specified by:
importContent in interface ContentImporter
Parameters:
parent - the root node for the imported content
name - the name of the imported content. The file extension determines the content type
contentStream - the content stream to be imported
importOptions - (optional) additional options to control the import
importListener - (optional) listener to receive callbacks for each change in the import
Throws:
javax.jcr.RepositoryException
IOException

digestPassword

public String digestPassword(String pwd)
                      throws IllegalArgumentException
Description copied from interface: JcrContentHelper
Digest the given password using the configured digest algorithm

Specified by:
digestPassword in interface JcrContentHelper
Parameters:
pwd - the password to digest
Returns:
digested password
Throws:
IllegalArgumentException

getMimeType

public String getMimeType(String name)
Description copied from interface: JcrContentHelper
Returns the MIME type from the MimeTypeService for the given name

Specified by:
getMimeType in interface JcrContentHelper
Parameters:
name - the name of the file to get the mimeType for

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)
Activates this component, called by SCR before registering as a service


deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
Deativates this component, called by SCR to take out of service



Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.