Package org.apache.jackrabbit.server.io
Interface IOHandler
-
- All Known Implementing Classes:
DefaultHandler,DirListingExportHandler,VersionHandler,VersionHistoryHandler,XmlHandler,ZipHandler
public interface IOHandlerIOHandlerinterface defines methods for importing and exporting resource content as well as some fundamental resource properties which use to be set/retrieved together with content import and export (e.g. content length, modification date etc.).
-
-
Method Summary
All Methods Instance Methods Abstract 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.booleancanImport(ImportContext context, boolean isCollection)Returns true, if this handler can run a successful import based on the specified context.booleancanImport(ImportContext context, DavResource resource)Returns true, if this handler can run a successful import based on the specified context and resource.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.IOManagergetIOManager()Returns theIOManagerthat called this handler ornull.StringgetName()Returns a human readable name for thisIOHandler.booleanimportContent(ImportContext context, boolean isCollection)Runs the import for the given context and indicates by a boolean return value, if the import could be completed successfully.booleanimportContent(ImportContext context, DavResource resource)Runs the import for the given context and resource.voidsetIOManager(IOManager ioManager)Sets theIOManagerthat called this handler.
-
-
-
Method Detail
-
getIOManager
IOManager getIOManager()
Returns theIOManagerthat called this handler ornull.
-
setIOManager
void setIOManager(IOManager ioManager)
Sets theIOManagerthat called this handler.
-
getName
String getName()
Returns a human readable name for thisIOHandler.
-
canImport
boolean canImport(ImportContext context, boolean isCollection)
Returns true, if this handler can run a successful import based on the specified context.
-
canImport
boolean canImport(ImportContext context, DavResource resource)
Returns true, if this handler can run a successful import based on the specified context and resource. A simple implementation may choose to return the same ascanImport(ImportContext, boolean)where the isCollection flag is determined byDavResource.isCollection().
-
importContent
boolean importContent(ImportContext context, boolean isCollection) throws IOException
Runs the import for the given context and indicates by a boolean return value, if the import could be completed successfully. If the specifiedImportContextdoes not provide astreamthe implementation is free, to only import properties of to refuse the import.Please note, that it is the responsibility of the specified
ImportContextto assert, that its stream is not consumed multiple times when being passed to a chain ofIOHandlers.- Parameters:
context-isCollection-- Returns:
- true if the import was successful.
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughcanImport(ImportContext, boolean)returns false.
-
importContent
boolean importContent(ImportContext context, DavResource resource) throws IOException
Runs the import for the given context and resource. It indicates by a boolean return value, if the import could be completed successfully. If the specifiedImportContextdoes not provide astreamthe implementation is free, to only import properties of to refuse the import. A simple implementation may return the same asimportContent(ImportContext, boolean)where the isCollection flag is determined byDavResource.isCollection()Please note, that it is the responsibility of the specified
ImportContextto assert, that its stream is not consumed multiple times when being passed to a chain ofIOHandlers.- Parameters:
context-resource-- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughcanImport(ImportContext, DavResource)returns false.- See Also:
importContent(ImportContext, boolean)
-
canExport
boolean canExport(ExportContext context, boolean isCollection)
Returns true, if this handler can run a successful export based on the specified context.
-
canExport
boolean canExport(ExportContext context, DavResource resource)
Returns 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 ascanExport(ExportContext, boolean)where the isCollection flag is determined byDavResource.isCollection().
-
exportContent
boolean exportContent(ExportContext context, boolean isCollection) throws IOException
Runs 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 asexportContent(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.- Parameters:
context-isCollection-- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughcanExport(ExportContext, boolean)returns false.
-
exportContent
boolean exportContent(ExportContext context, DavResource resource) throws IOException
Runs 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 asexportContent(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.- Parameters:
context-resource-- Returns:
- Throws:
IOException- if an unexpected error occurs or if this method has been called althoughcanExport(ExportContext, DavResource)returns false.
-
-