org.pentaho.reporting.libraries.repository
public class RepositoryUtilities extends Object
Method Summary | |
---|---|
static String | buildName(ContentEntity entity, String separator)
Builds a string of an absolute pathname for the given entity and using the given separator to separate filename
segments..
|
static String[] | buildNameArray(ContentEntity entity)
Builds a absolute pathname for the given entity.
|
static ContentItem | createItem(Repository repository, String[] name)
Tries to create a content item with the given path-name in the repository. |
static ContentLocation | createLocation(Repository repository, String[] name)
Tries to create a content location with the given path-name in the repository. |
static ContentEntity | getEntity(Repository repository, 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, String[] name)
Checks whether a given pathname points to a valid content entity.
|
static boolean | isInvalidPathName(String name)
Checks whether the given entity name is valid for filesystems. |
static String[] | split(String name, String separator)
Splits a string on the given separator. |
static String[] | splitPath(String name, String separator)
Splits a string on the given separator. |
static void | writeAsZip(OutputStream outputStream, Repository repository)
Writes the given repository as ZIP-File into the given output stream.
|
static void | writeToZipStream(ZipOutputStream zipOutputStream, Repository repository)
Writes the given repository to the given ZIP-output stream.
|
Parameters: entity the entity for which the pathname should be computed. separator the filename separator.
Returns: the absolute path.
Parameters: entity the entity for which the pathname should be computed.
Returns: the absolute path.
Parameters: repository the repository in which a new entity should be created. name the name of the new entity as path name.
Returns: the newly created content-item.
Throws: ContentIOException if an repository error occured or if the path was not valid.
Parameters: repository the repository in which a new entity should be created. name the name of the new entity as path name.
Returns: the newly created content-location.
Throws: ContentIOException if an repository error occured or if the path was not valid.
Parameters: repository the repository from where to retrieve the content entity. name the path name as array of name-segments.
Returns: the entity at the position, never null.
Throws: ContentIOException if the path did not point to a valid content entity.
See Also: RepositoryUtilities
Parameters: item the content item for which the compression factor should be computed.
Returns: the compression level.
Parameters: item the content item for which the compression mode should be computed.
Returns: the compression mode, either ZipOutputStream.DEFLATED or ZipOutputStream.STORED.
Parameters: repository the repository from where to retrieve the content entity. name the path name as array of name-segments.
Returns: true, if the entity exists, false otherwise.
Throws: ContentIOException if an unexpected repository error occured.
See Also: RepositoryUtilities
Parameters: name the filename that should be tested. This name must be a single name section, not a full path.
Returns: true, if the pathname is valid, false otherwise.
Parameters: name the path name. separator the separator on which to split.
Returns: the name as array of atomar path elements.
Parameters: name the path name. separator the separator on which to split.
Returns: the name as array of atomar path elements.
Parameters: outputStream the output stream that should receive the zipfile. repository the repository that should be written.
Throws: IOException if an IO error prevents the writing of the file. ContentIOException if a repository related IO error occurs.
Parameters: zipOutputStream the output stream that represents the ZipFile to be generated. repository the repository that should be written.
Throws: IOException if an IO error prevents the writing of the file. ContentIOException if a repository related IO error occurs.