|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.repository.RepositoryUtilities
public class RepositoryUtilities
A collection of repository related helper methods that make it easier to work with repositories.
Method Summary | |
---|---|
static java.lang.String |
buildName(ContentEntity entity,
java.lang.String separator)
Builds a string of an absolute pathname for the given entity and using the given separator to separate filename segments.. |
static java.lang.String[] |
buildNameArray(ContentEntity entity)
Builds a absolute pathname for the given entity. |
static ContentItem |
createItem(Repository repository,
java.lang.String[] name)
Tries to create a content item with the given path-name in the repository. |
static ContentLocation |
createLocation(Repository repository,
java.lang.String[] name)
Tries to create a content location with the given path-name in the repository. |
static ContentEntity |
getEntity(Repository repository,
java.lang.String[] name)
Returns the content entity for the given path name. |
static int |
getZipLevel(ContentItem item)
Computes the declared Zip-Compression level for the given content-item. |
static int |
getZipMethod(ContentItem item)
Computes the declared Zip-Compression mode for the given content-item. |
static boolean |
isExistsEntity(Repository repository,
java.lang.String[] name)
Checks whether a given pathname points to a valid content entity. |
static boolean |
isInvalidPathName(java.lang.String name)
Checks whether the given entity name is valid for filesystems. |
static java.lang.String[] |
split(java.lang.String name,
java.lang.String separator)
Splits a string on the given separator. |
static java.lang.String[] |
splitPath(java.lang.String name,
java.lang.String separator)
Splits a string on the given separator. |
static void |
writeAsZip(java.io.OutputStream outputStream,
Repository repository)
Writes the given repository as ZIP-File into the given output stream. |
static void |
writeToZipStream(java.util.zip.ZipOutputStream zipOutputStream,
Repository repository)
Writes the given repository to the given ZIP-output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ContentEntity getEntity(Repository repository, java.lang.String[] name) throws ContentIOException
repository
- the repository from where to retrieve the content entity.name
- the path name as array of name-segments.
ContentIOException
- if the path did not point to a valid content entity.splitPath(String, String)
public static boolean isExistsEntity(Repository repository, java.lang.String[] name) throws ContentIOException
repository
- the repository from where to retrieve the content entity.name
- the path name as array of name-segments.
ContentIOException
- if an unexpected repository error occured.splitPath(String, String)
public static ContentItem createItem(Repository repository, java.lang.String[] name) throws ContentIOException
repository
- the repository in which a new entity should be created.name
- the name of the new entity as path name.
ContentIOException
- if an repository error occured or if the path was not valid.public static ContentLocation createLocation(Repository repository, java.lang.String[] name) throws ContentIOException
repository
- the repository in which a new entity should be created.name
- the name of the new entity as path name.
ContentIOException
- if an repository error occured or if the path was not valid.public static java.lang.String[] splitPath(java.lang.String name, java.lang.String separator)
name
- the path name.separator
- the separator on which to split.
public static java.lang.String[] split(java.lang.String name, java.lang.String separator)
name
- the path name.separator
- the separator on which to split.
public static java.lang.String[] buildNameArray(ContentEntity entity)
entity
- the entity for which the pathname should be computed.
public static java.lang.String buildName(ContentEntity entity, java.lang.String separator)
entity
- the entity for which the pathname should be computed.separator
- the filename separator.
public static boolean isInvalidPathName(java.lang.String name)
name
- the filename that should be tested. This name must be a single name section, not a full path.
public static void writeAsZip(java.io.OutputStream outputStream, Repository repository) throws java.io.IOException, ContentIOException
outputStream
- the output stream that should receive the zipfile.repository
- the repository that should be written.
java.io.IOException
- if an IO error prevents the writing of the file.
ContentIOException
- if a repository related IO error occurs.public static void writeToZipStream(java.util.zip.ZipOutputStream zipOutputStream, Repository repository) throws java.io.IOException, ContentIOException
zipOutputStream
- the output stream that represents the ZipFile to be generated.repository
- the repository that should be written.
java.io.IOException
- if an IO error prevents the writing of the file.
ContentIOException
- if a repository related IO error occurs.public static int getZipLevel(ContentItem item)
item
- the content item for which the compression factor should be computed.
public static int getZipMethod(ContentItem item)
item
- the content item for which the compression mode should be computed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |