Interface IOHandler

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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 isCollection)
      Returns true, if this handler can run a successful import based on the specified context.
      boolean canImport​(ImportContext context, org.apache.jackrabbit.webdav.DavResource resource)
      Returns true, if this handler can run a successful import based on the specified context and resource.
      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)
      Runs the import for the given context and indicates by a boolean return value, if the import could be completed successfully.
      boolean importContent​(ImportContext context, org.apache.jackrabbit.webdav.DavResource resource)
      Runs the import for the given context and resource.
      void setIOManager​(IOManager ioManager)
      Sets the IOManager that called this handler.
    • Method Detail

      • getIOManager

        IOManager getIOManager()
        Returns the IOManager that called this handler or null.
      • setIOManager

        void setIOManager​(IOManager ioManager)
        Sets the IOManager that called this handler.
      • getName

        String getName()
        Returns a human readable name for this IOHandler.
      • 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,
                          org.apache.jackrabbit.webdav.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 as canImport(ImportContext, boolean) where the isCollection flag is determined by DavResource.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 specified ImportContext does not provide a stream the implementation is free, to only import properties of to refuse the import.

        Please note, that it is the responsibility of the specified ImportContext to assert, that its stream is not consumed multiple times when being passed to a chain of IOHandlers.

        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 canImport(ImportContext, boolean) returns false.
      • importContent

        boolean importContent​(ImportContext context,
                              org.apache.jackrabbit.webdav.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 specified ImportContext does not provide a stream the implementation is free, to only import properties of to refuse the import. A simple implementation may return the same as importContent(ImportContext, boolean) where the isCollection flag is determined by DavResource.isCollection()

        Please note, that it is the responsibility of the specified ImportContext to assert, that its stream is not consumed multiple times when being passed to a chain of IOHandlers.

        Parameters:
        context -
        resource -
        Returns:
        Throws:
        IOException - if an unexpected error occurs or if this method has been called although canImport(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,
                          org.apache.jackrabbit.webdav.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 as canExport(ExportContext, boolean) where the isCollection flag is determined by DavResource.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 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 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.

        Parameters:
        context -
        isCollection -
        Returns:
        Throws:
        IOException - if an unexpected error occurs or if this method has been called although canExport(ExportContext, boolean) returns false.
      • exportContent

        boolean exportContent​(ExportContext context,
                              org.apache.jackrabbit.webdav.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 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 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.

        Parameters:
        context -
        resource -
        Returns:
        Throws:
        IOException - if an unexpected error occurs or if this method has been called although canExport(ExportContext, DavResource) returns false.