Package org.apache.jackrabbit.server.io
Class DirListingExportHandler
- java.lang.Object
-
- org.apache.jackrabbit.server.io.DirListingExportHandler
-
- All Implemented Interfaces:
IOHandler,PropertyHandler
public class DirListingExportHandler extends Object implements IOHandler, PropertyHandler
DirListingExportHandlerrepresents a simple export for collections: a human-readable view listing the members.Note: If
exportContent(ExportContext, boolean)is called the view list child nodes only, without respecting their representation asDavResources.
-
-
Constructor Summary
Constructors Constructor Description DirListingExportHandler()Creates a newDirListingExportHandlerDirListingExportHandler(IOManager ioManager)Creates a newDirListingExportHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExport(ExportContext context, boolean isCollection)Returns true, if this handler can run a successful export based on the specified context.booleancanExport(ExportContext context, DavResource resource)Returns true, if this handler can run a successful export based on the specified context and resource.booleancanExport(PropertyExportContext context, boolean isCollection)Always returns false.booleancanImport(ImportContext context, boolean isFolder)Always returns falsebooleancanImport(ImportContext context, DavResource resource)Always returns falsebooleancanImport(PropertyImportContext context, boolean isCollection)Returns true, if this handler can run a property import based on the specified context.booleanexportContent(ExportContext context, boolean isCollection)Runs the export for the given context.booleanexportContent(ExportContext context, DavResource resource)Runs the export for the given context and resource.booleanexportProperties(PropertyExportContext exportContext, boolean isCollection)Exports properties to the given context.IOManagergetIOManager()Returns theIOManagerthat called this handler ornull.StringgetName()Returns a human readable name for thisIOHandler.booleanimportContent(ImportContext context, boolean isCollection)Does nothing and returns falsebooleanimportContent(ImportContext context, DavResource resource)Does nothing and returns falseMap<? extends PropEntry,?>importProperties(PropertyImportContext importContext, boolean isCollection)Imports, modifies or removes properties according the thechange listavailable from the import context.voidsetIOManager(IOManager ioManager)Sets theIOManagerthat called this handler.
-
-
-
Constructor Detail
-
DirListingExportHandler
public DirListingExportHandler()
Creates a newDirListingExportHandler
-
DirListingExportHandler
public DirListingExportHandler(IOManager ioManager)
Creates a newDirListingExportHandler- Parameters:
ioManager-
-
-
Method Detail
-
canImport
public boolean canImport(ImportContext context, boolean isFolder)
Always returns false- Specified by:
canImportin interfaceIOHandler- See Also:
IOHandler.canImport(ImportContext, boolean)
-
canImport
public boolean canImport(ImportContext context, DavResource resource)
Always returns false- Specified by:
canImportin interfaceIOHandler- See Also:
IOHandler.canImport(ImportContext, DavResource)
-
importContent
public boolean importContent(ImportContext context, boolean isCollection) throws IOException
Does nothing and returns false- Specified by:
importContentin interfaceIOHandler- Returns:
- true if the import was successful.
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canImport(ImportContext, boolean)returns false.- See Also:
IOHandler.importContent(ImportContext, boolean)
-
importContent
public boolean importContent(ImportContext context, DavResource resource) throws IOException
Does nothing and returns false- Specified by:
importContentin interfaceIOHandler- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canImport(ImportContext, DavResource)returns false.- See Also:
IOHandler.importContent(ImportContext, DavResource)
-
canExport
public boolean canExport(ExportContext context, boolean isCollection)
Description copied from interface:IOHandlerReturns true, if this handler can run a successful export based on the specified context.- Specified by:
canExportin interfaceIOHandler- Returns:
- true if the specified context is still valid and provides a export root and if 'isCollection' is true. False otherwise
- See Also:
IOHandler.canExport(ExportContext, boolean)
-
canExport
public boolean canExport(ExportContext context, DavResource resource)
Description copied from interface:IOHandlerReturns true, if this handler can run a successful export based on the specified context and resource. A simple implementation may choose to return the same asIOHandler.canExport(ExportContext, boolean)where the isCollection flag is determined byDavResource.isCollection().- Specified by:
canExportin interfaceIOHandler- Returns:
- true if the specified context is still valid and provides a export root and if the specified resource is a collection. False otherwise.
- See Also:
IOHandler.canExport(ExportContext, DavResource),DavResource.isCollection()
-
exportContent
public boolean exportContent(ExportContext context, boolean isCollection) throws IOException
Description copied from interface:IOHandlerRuns the export for the given context. It indicates by a boolean return value, if the export could be completed successfully. If the specifiedExportContextdoes not provide astreamthe implementation should set the properties only and ignore the content to be exported. A simple implementation may return the same asIOHandler.exportContent(ExportContext, boolean)where the isCollection flag is determined byDavResource.isCollection()Please note, that it is the responsibility of the specified
ExportContextto assert, that its stream is not written multiple times when being passed to a chain ofIOHandlers.- Specified by:
exportContentin interfaceIOHandler- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canExport(ExportContext, boolean)returns false.- See Also:
IOHandler.exportContent(ExportContext, boolean)
-
exportContent
public boolean exportContent(ExportContext context, DavResource resource) throws IOException
Description copied from interface:IOHandlerRuns the export for the given context and resource. It indicates by a boolean return value, if the export could be completed successfully. If the specifiedExportContextdoes not provide astreamthe implementation should set the properties only and ignore the content to be exported. A simple implementation may return the same asIOHandler.exportContent(ExportContext, boolean)where the isCollection flag is determined byDavResource.isCollection()Please note, that it is the responsibility of the specified
ExportContextto assert, that its stream is not written multiple times when being passed to a chain ofIOHandlers.- Specified by:
exportContentin interfaceIOHandler- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughIOHandler.canExport(ExportContext, DavResource)returns false.- See Also:
IOHandler.exportContent(ExportContext, DavResource)
-
getIOManager
public IOManager getIOManager()
Description copied from interface:IOHandlerReturns theIOManagerthat called this handler ornull.- Specified by:
getIOManagerin interfaceIOHandler- See Also:
IOHandler.getIOManager()
-
setIOManager
public void setIOManager(IOManager ioManager)
Description copied from interface:IOHandlerSets theIOManagerthat called this handler.- Specified by:
setIOManagerin interfaceIOHandler- See Also:
IOHandler.setIOManager(IOManager)
-
getName
public String getName()
Description copied from interface:IOHandlerReturns a human readable name for thisIOHandler.- Specified by:
getNamein interfaceIOHandler- See Also:
IOHandler.getName()
-
canExport
public boolean canExport(PropertyExportContext context, boolean isCollection)
Always returns false.- Specified by:
canExportin interfacePropertyHandler- Parameters:
context-isCollection-- Returns:
- always returns false.
-
exportProperties
public boolean exportProperties(PropertyExportContext exportContext, boolean isCollection) throws RepositoryException
Description copied from interface:PropertyHandlerExports properties to the given context. Note that the export must be consistent with properties that might be exposed by content export such as defined byIOHandler.exportContent(ExportContext, boolean).- Specified by:
exportPropertiesin interfacePropertyHandler- Returns:
- true if the export succeeded.
- Throws:
RepositoryException- If an attempt is made to export properties even ifPropertyHandler.canExport(PropertyExportContext, boolean)returns false or if some other unrecoverable error occurs.- See Also:
PropertyHandler.exportProperties(PropertyExportContext, boolean)
-
canImport
public boolean canImport(PropertyImportContext context, boolean isCollection)
Description copied from interface:PropertyHandlerReturns true, if this handler can run a property import based on the specified context.- Specified by:
canImportin interfacePropertyHandler- Returns:
- true if this
PropertyHandlercan import properties given the specified parameters.
-
importProperties
public Map<? extends PropEntry,?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException
Description copied from interface:PropertyHandlerImports, modifies or removes properties according the thechange listavailable from the import context. Note, that according to JSR 170 setting a property value tonullis equivalent to its removal.The return value of this method must be used to provided detailed information about any kind of failures.
- Specified by:
importPropertiesin interfacePropertyHandler- Returns:
- Map listing those properties that failed to be updated. An empty map indicates a successful import for all properties listed in the context.
- Throws:
RepositoryException- IfPropertyHandler.canImport(PropertyImportContext, boolean)returns false for the given parameters or if some other unrecoverable error occurred. Note, that normal failure of a property update must be reported with the return value and should not result in an exception.- See Also:
PropertyHandler.importProperties(PropertyImportContext, boolean)
-
-