org.apache.jackrabbit.server.io
Class DirListingExportHandler

java.lang.Object
  extended byorg.apache.jackrabbit.server.io.DirListingExportHandler
All Implemented Interfaces:
IOHandler

public class DirListingExportHandler
extends Object
implements IOHandler

DirListingExportHandler represents 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 as DavResources.


Constructor Summary
DirListingExportHandler(IOManager ioManager)
          Creates a new DirListingExportHandler
 
Method Summary
 boolean canExport(ExportContext context, boolean isCollection)
          Returns true, if this handler can run a successful export based on the specified context.
 boolean canExport(ExportContext context, org.apache.jackrabbit.webdav.DavResource resource)
          Returns true, if this handler can run a successful export based on the specified context and resource.
 boolean canImport(ImportContext context, boolean isFolder)
          Always returns false
 boolean canImport(ImportContext context, org.apache.jackrabbit.webdav.DavResource resource)
          Always returns false
 boolean exportContent(ExportContext context, boolean isCollection)
          Runs the export for the given context.
 boolean exportContent(ExportContext context, org.apache.jackrabbit.webdav.DavResource resource)
          Runs the export for the given context and resource.
 IOManager getIOManager()
          Returns the IOManager that called this handler or null.
 String getName()
          Returns a human readable name for this IOHandler
 boolean importContent(ImportContext context, boolean isCollection)
          Does nothing and returns false
 boolean importContent(ImportContext context, org.apache.jackrabbit.webdav.DavResource resource)
          Does nothing and returns false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirListingExportHandler

public DirListingExportHandler(IOManager ioManager)
Creates a new DirListingExportHandler

Parameters:
ioManager -
Method Detail

canImport

public boolean canImport(ImportContext context,
                         boolean isFolder)
Always returns false

Specified by:
canImport in interface IOHandler
Parameters:
context -
isFolder -
Returns:
See Also:
IOHandler.canImport(ImportContext, boolean)

canImport

public boolean canImport(ImportContext context,
                         org.apache.jackrabbit.webdav.DavResource resource)
Always returns false

Specified by:
canImport in interface IOHandler
Parameters:
context -
resource -
Returns:
See Also:
IOHandler.canImport(ImportContext, DavResource)

importContent

public boolean importContent(ImportContext context,
                             boolean isCollection)
                      throws IOException
Does nothing and returns false

Specified by:
importContent in interface IOHandler
Parameters:
context -
isCollection -
Returns:
true if the import was successful.
Throws:
IOException - if an unexpected error occurs or if this method has been called although IOHandler.canImport(ImportContext, boolean) returns false.
See Also:
IOHandler.importContent(ImportContext, boolean)

importContent

public boolean importContent(ImportContext context,
                             org.apache.jackrabbit.webdav.DavResource resource)
                      throws IOException
Does nothing and returns false

Specified by:
importContent in interface IOHandler
Parameters:
context -
resource -
Returns:
Throws:
IOException - if an unexpected error occurs or if this method has been called although IOHandler.canImport(ImportContext, DavResource) returns false.
See Also:
IOHandler.importContent(ImportContext, DavResource)

canExport

public boolean canExport(ExportContext context,
                         boolean isCollection)
Description copied from interface: IOHandler
Returns true, if this handler can run a successful export based on the specified context.

Specified by:
canExport in interface IOHandler
Parameters:
context -
isCollection -
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,
                         org.apache.jackrabbit.webdav.DavResource resource)
Description copied from interface: IOHandler
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 as IOHandler.canExport(ExportContext, boolean) where the isCollection flag is determined by DavResource.isCollection().

Specified by:
canExport in interface IOHandler
Parameters:
context -
resource -
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: IOHandler
Runs the export for the given context. It indicates by a boolean return value, if the export could be completed successfully. If the specified ExportContext does not provide a stream the implementation should set the properties only and ignore the content to be exported. A simple implementation may return the same as IOHandler.exportContent(ExportContext, boolean) where the isCollection flag is determined by DavResource.isCollection()
Please note, that it is the responsibility of the specified ExportContext to assert, that its stream is not written multiple times when being passed to a chain of IOHandlers.

Specified by:
exportContent in interface IOHandler
Parameters:
context -
isCollection -
Returns:
Throws:
IOException - if an unexpected error occurs or if this method has been called although IOHandler.canExport(ExportContext, boolean) returns false.
See Also:
IOHandler.exportContent(ExportContext, boolean)

exportContent

public boolean exportContent(ExportContext context,
                             org.apache.jackrabbit.webdav.DavResource resource)
                      throws IOException
Description copied from interface: IOHandler
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 specified ExportContext does not provide a stream the implementation should set the properties only and ignore the content to be exported. A simple implementation may return the same as IOHandler.exportContent(ExportContext, boolean) where the isCollection flag is determined by DavResource.isCollection()
Please note, that it is the responsibility of the specified ExportContext to assert, that its stream is not written multiple times when being passed to a chain of IOHandlers.

Specified by:
exportContent in interface IOHandler
Parameters:
context -
resource -
Returns:
Throws:
IOException - if an unexpected error occurs or if this method has been called although IOHandler.canExport(ExportContext, DavResource) returns false.
See Also:
IOHandler.exportContent(ExportContext, DavResource)

getIOManager

public IOManager getIOManager()
Description copied from interface: IOHandler
Returns the IOManager that called this handler or null.

Specified by:
getIOManager in interface IOHandler
Returns:
See Also:
IOHandler.getIOManager()

getName

public String getName()
Description copied from interface: IOHandler
Returns a human readable name for this IOHandler

Specified by:
getName in interface IOHandler
Returns:
See Also:
IOHandler.getName()


Copyright © 2005-2006 . All Rights Reserved.