Class WriteableDocumentBundleUtils


  • public final class WriteableDocumentBundleUtils
    extends Object
    A set of utilitiy methods for working with WritableDocumentBundles.
    • Method Detail

      • removeResource

        public static boolean removeResource​(WriteableDocumentBundle documentBundle,
                                             org.pentaho.reporting.libraries.resourceloader.ResourceKey resource)
                                      throws IOException
        Removes the specified resource from the resource bundle if that resource exists.
        Parameters:
        documentBundle - the bundle from which the resource will be removed
        resource - the reference to the resource to be removed
        Returns:
        true if the resource was removed, false otherwise
        Throws:
        IOException - indicates an error trying to remove the resource from the bundle
      • embedResource

        public static org.pentaho.reporting.libraries.resourceloader.ResourceKey embedResource​(WriteableDocumentBundle documentBundle,
                                                                                               org.pentaho.reporting.libraries.resourceloader.ResourceManager sourceManager,
                                                                                               org.pentaho.reporting.libraries.resourceloader.ResourceKey source,
                                                                                               String pattern,
                                                                                               String mimeType,
                                                                                               Map factoryParameters)
                                                                                        throws IOException,
                                                                                               org.pentaho.reporting.libraries.resourceloader.ResourceException
        Embeds the specified source resource into the specified document bundle
        Parameters:
        documentBundle - the bundle in which the resource will be embedded
        source - the ResourceKey to the source which will be embedded - NOTE: the pattern can specify an exact name or a pattern for creating a temporary name. If the name exists, it will be replaced.
        pattern - the pattern for the filename to be created
        mimeType - the mimeType of the file to be embedded
        factoryParameters - any factory parameters which should be added to the ResourceKey being created
        Returns:
        the ResourceKey for the newly created embedded entry
        Throws:
        IOException
        org.pentaho.reporting.libraries.resourceloader.ResourceException