public class BundleUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HIDDEN_FLAG |
static String |
STICKY_FLAG |
Modifier and Type | Method and Description |
---|---|
static void |
copyInto(WriteableDocumentBundle targetBundle,
DocumentBundle sourceBundle) |
static void |
copyInto(WriteableDocumentBundle targetBundle,
DocumentBundle sourceBundle,
String[] files) |
static void |
copyInto(WriteableDocumentBundle targetBundle,
DocumentBundle sourceBundle,
String[] files,
boolean ignoreSticky) |
static void |
copyInto(WriteableDocumentBundle bundle,
String targetPath,
ResourceKey dataKey,
ResourceManager resourceManager) |
static void |
copyMetaData(MemoryDocumentBundle memoryDocumentBundle,
DocumentBundle bundle) |
static void |
copyStickyInto(WriteableDocumentBundle targetBundle,
DocumentBundle sourceBundle) |
static DocumentBundle |
getBundle(File file) |
static String |
getBundleMapping(String bundleType) |
static String |
getBundleType(Repository repository) |
static String |
getUniqueName(DocumentBundle bundle,
String pattern) |
static String |
getUniqueName(DocumentBundle bundle,
String parent,
String pattern)
Returns an unique name for the given pattern, producing a file relative to the parent file name.
|
static boolean |
isSameBundle(ResourceKey elementSource,
ResourceKey attributeValue) |
static Date |
parseDate(String date) |
static Date |
parseDuration(String duration) |
static void |
writeAsZip(File target,
DocumentBundle bundle) |
static void |
writeAsZip(OutputStream targetStream,
DocumentBundle bundle) |
static void |
writeToDirectory(File target,
DocumentBundle bundle) |
static void |
writeToRepository(Repository repository,
DocumentBundle bundle) |
public static final String STICKY_FLAG
public static final String HIDDEN_FLAG
public static void copyInto(WriteableDocumentBundle bundle, String targetPath, ResourceKey dataKey, ResourceManager resourceManager) throws IOException, ResourceLoadingException
IOException
ResourceLoadingException
public static String getBundleType(Repository repository)
public static void writeAsZip(File target, DocumentBundle bundle) throws IOException, ContentIOException
IOException
ContentIOException
public static void writeAsZip(OutputStream targetStream, DocumentBundle bundle) throws ContentIOException, IOException
ContentIOException
IOException
public static void writeToDirectory(File target, DocumentBundle bundle) throws ContentIOException, IOException
ContentIOException
IOException
public static void writeToRepository(Repository repository, DocumentBundle bundle) throws ContentIOException, IOException
ContentIOException
IOException
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) throws IOException
IOException
public static void copyStickyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle) throws IOException
IOException
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files) throws IOException
IOException
public static void copyInto(WriteableDocumentBundle targetBundle, DocumentBundle sourceBundle, String[] files, boolean ignoreSticky) throws IOException
IOException
public static String getUniqueName(DocumentBundle bundle, String parent, String pattern)
org.pentaho.reporting.libraries.base.util.IOUtils#createRelativePath(java
.lang.String,
java.lang.String)
to transform the absolute path returned here into a path relative to your current context.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.IllegalStateException
- if the first 2 million entries we test do not yield a unique name we can use.public static String getUniqueName(DocumentBundle bundle, String pattern)
public static boolean isSameBundle(ResourceKey elementSource, ResourceKey attributeValue)
public static DocumentBundle getBundle(File file) throws ResourceException
ResourceException
public static void copyMetaData(MemoryDocumentBundle memoryDocumentBundle, DocumentBundle bundle)
Copyright © 2017 Hitachi Vantara. All rights reserved.