public final class WriteableDocumentBundleUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ResourceKey |
embedResource(WriteableDocumentBundle documentBundle,
ResourceManager sourceManager,
ResourceKey source,
String pattern,
String mimeType,
Map factoryParameters)
Embeds the specified source resource into the specified document bundle
|
static boolean |
removeResource(WriteableDocumentBundle documentBundle,
ResourceKey resource)
Removes the specified resource from the resource bundle if that resource exists.
|
public static boolean removeResource(WriteableDocumentBundle documentBundle, ResourceKey resource) throws IOException
documentBundle
- the bundle from which the resource will be removedresource
- the reference to the resource to be removedtrue
if the resource was removed, false
otherwiseIOException
- indicates an error trying to remove the resource from the bundlepublic static ResourceKey embedResource(WriteableDocumentBundle documentBundle, ResourceManager sourceManager, ResourceKey source, String pattern, String mimeType, Map factoryParameters) throws IOException, ResourceException
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 createdIOException
ResourceException
Copyright © 2017 Hitachi Vantara. All rights reserved.