Class WriteableDocumentBundleUtils
- java.lang.Object
-
- org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundleUtils
-
public final class WriteableDocumentBundleUtils extends Object
A set of utilitiy methods for working with WritableDocumentBundles.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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)
Embeds the specified source resource into the specified document bundlestatic boolean
removeResource(WriteableDocumentBundle documentBundle, org.pentaho.reporting.libraries.resourceloader.ResourceKey resource)
Removes the specified resource from the resource bundle if that resource exists.
-
-
-
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 removedresource
- 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 embeddedsource
- 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 createdmimeType
- the mimeType of the file to be embeddedfactoryParameters
- 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
-
-