Class BundleUtilities
java.lang.Object
org.pentaho.reporting.libraries.docbundle.BundleUtilities
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyInto(WriteableDocumentBundle bundle, String targetPath, org.pentaho.reporting.libraries.resourceloader.ResourceKey dataKey, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager) static voidcopyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) static voidcopyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files) static voidcopyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files, boolean ignoreSticky) static voidcopyMetaData(MemoryDocumentBundle memoryDocumentBundle, DocumentBundle bundle) static voidcopyStickyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) static DocumentBundlestatic StringgetBundleMapping(String bundleType) static StringgetBundleType(org.pentaho.reporting.libraries.repository.Repository repository) static StringgetUniqueName(DocumentBundle bundle, String pattern) static StringgetUniqueName(DocumentBundle bundle, String parent, String pattern) Returns an unique name for the given pattern, producing a file relative to the parent file name.static booleanisSameBundle(org.pentaho.reporting.libraries.resourceloader.ResourceKey elementSource, org.pentaho.reporting.libraries.resourceloader.ResourceKey attributeValue) static Datestatic DateparseDuration(String duration) static voidwriteAsZip(File target, DocumentBundle bundle) static voidwriteAsZip(OutputStream targetStream, DocumentBundle bundle) static voidwriteToDirectory(File target, DocumentBundle bundle) static voidwriteToRepository(org.pentaho.reporting.libraries.repository.Repository repository, DocumentBundle bundle)
-
Field Details
-
STICKY_FLAG
- See Also:
-
HIDDEN_FLAG
- See Also:
-
-
Method Details
-
copyInto
public static void copyInto(WriteableDocumentBundle bundle, String targetPath, org.pentaho.reporting.libraries.resourceloader.ResourceKey dataKey, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager) throws IOException, org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException - Throws:
IOExceptionorg.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
-
getBundleType
public static String getBundleType(org.pentaho.reporting.libraries.repository.Repository repository) -
getBundleMapping
-
writeAsZip
public static void writeAsZip(File target, DocumentBundle bundle) throws IOException, org.pentaho.reporting.libraries.repository.ContentIOException - Throws:
IOExceptionorg.pentaho.reporting.libraries.repository.ContentIOException
-
writeAsZip
public static void writeAsZip(OutputStream targetStream, DocumentBundle bundle) throws org.pentaho.reporting.libraries.repository.ContentIOException, IOException - Throws:
org.pentaho.reporting.libraries.repository.ContentIOExceptionIOException
-
writeToDirectory
public static void writeToDirectory(File target, DocumentBundle bundle) throws org.pentaho.reporting.libraries.repository.ContentIOException, IOException - Throws:
org.pentaho.reporting.libraries.repository.ContentIOExceptionIOException
-
writeToRepository
public static void writeToRepository(org.pentaho.reporting.libraries.repository.Repository repository, DocumentBundle bundle) throws org.pentaho.reporting.libraries.repository.ContentIOException, IOException - Throws:
org.pentaho.reporting.libraries.repository.ContentIOExceptionIOException
-
copyInto
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) throws IOException - Throws:
IOException
-
copyStickyInto
public static void copyStickyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) throws IOException - Throws:
IOException
-
copyInto
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files) throws IOException - Throws:
IOException
-
copyInto
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files, boolean ignoreSticky) throws IOException - Throws:
IOException
-
getUniqueName
Returns an unique name for the given pattern, producing a file relative to the parent file name. The returned path will be an absolute path starting from the root of the bundle. When linking to this path via href-references that imply relative paths, useIOUtils.createRelativePath(java.lang.String, java.lang.String)to transform the absolute path returned here into a path relative to your current context.- Parameters:
bundle- the document bundle for which we seek a new unique file name.parent- the parent path to which the pattern is relative to.pattern- the file name pattern. We expect one parameter only.- Returns:
- the unique file name, never null.
- Throws:
IllegalStateException- if the first 2 million entries we test do not yield a unique name we can use.
-
getUniqueName
-
isSameBundle
public static boolean isSameBundle(org.pentaho.reporting.libraries.resourceloader.ResourceKey elementSource, org.pentaho.reporting.libraries.resourceloader.ResourceKey attributeValue) -
getBundle
public static DocumentBundle getBundle(File file) throws org.pentaho.reporting.libraries.resourceloader.ResourceException - Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceException
-
parseDate
-
parseDuration
-
copyMetaData
-