| java.lang.Object org.apache.lenya.cms.cocoon.source.SourceUtil
SourceUtil | final public class SourceUtil (Code) | | version: $Id: SourceUtil.java 507914 2007-02-15 12:15:30Z andreas $ |
Method Summary | |
public static void | checkin(String sourceUri, ServiceManager manager) Checks in a transactionable source. | public static void | checkout(String sourceUri, ServiceManager manager) Checks out a repository source. | public static void | copy(Source source, ModifiableSource destination, boolean useBuffer)
Copies one Source to another using a source buffer i.e. | public static void | copy(SourceResolver resolver, String sourceUri, String destUri, boolean useBuffer) Copies one Source to another. | public static void | copy(SourceResolver resolver, String sourceUri, String destUri) Copies a Source without buffering. | public static void | copy(ServiceManager manager, String sourceUri, String destUri) Copies a Source without buffering. | public static void | copy(SourceResolver resolver, String sourceUri, OutputStream destOutputStream) | public static void | delete(String sourceUri, ServiceManager manager) Deletes a source if it exists. | public static void | deleteEmptyCollections(String sourceUri, ServiceManager manager) Deletes all empty collections in a subtree. | public static boolean | exists(String sourceUri, ServiceManager manager) Checks if a source exists.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. | public static long | getContentLength(String sourceUri, ServiceManager manager) Parameters: sourceUri - The source URI. Parameters: manager - The service manager. | public static long | getLastModified(String sourceUri, ServiceManager manager) Returns the last modification date of a source.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. | public static String | getMimeType(String sourceUri, ServiceManager manager) Parameters: sourceUri - The source URI. Parameters: manager - The service manager. | public static void | lock(String sourceUri, ServiceManager manager) Locks a transactionable source. | public static Document | readDOM(String sourceUri, ServiceManager manager) Reads a DOM from a source.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. | public static void | registerDirty(String sourceUri, ServiceManager manager) Registers a source as dirty. | public static void | unlock(String sourceUri, ServiceManager manager) Unlocks a transactionable source. | public static void | writeDOM(Document document, String sourceUri, ServiceManager manager) Writes a DOM to a source. | public static void | writeDOM(Document document, OutputStream oStream) |
copy | public static void copy(Source source, ModifiableSource destination, boolean useBuffer) throws IOException(Code) | |
Copies one Source to another using a source buffer i.e. the source Source
is buffered before it is copied to its final destination.
The optional buffering is sometimes useful, if the source Source somehow
depends on the destination Source. This situation may occur e.g. if
source Source is a Cocoon pipeline.
NOTE: o.a.e..s.SourceUtil.copy does not close streams on an
exception!!
Parameters: source - Parameters: destination - Parameters: useBuffer - If true, the source data will be read into a bufferbefore it is written to the final destination. throws: IOException - If an error occures. |
copy | public static void copy(SourceResolver resolver, String sourceUri, String destUri, boolean useBuffer) throws IOException, SourceException(Code) | | Copies one Source to another. The source Source is optionally buffered.
Parameters: resolver - The SourceResolver to use for lookin up Sources. Parameters: sourceUri - The source to be copied. Parameters: destUri - The URI to copy to. Parameters: useBuffer - If true, the source Source is buffered before copied tothe final destination. throws: IOException - If an error occures. throws: SourceException - If the destination is not modifiable. See Also: SourceUtil.copy(Source,ModifiableSource,boolean) |
delete | public static void delete(String sourceUri, ServiceManager manager) throws ServiceException, MalformedURLException, IOException(Code) | | Deletes a source if it exists.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. throws: ServiceException - if an error occurs. throws: MalformedURLException - if an error occurs. throws: IOException - if an error occurs. |
deleteEmptyCollections | public static void deleteEmptyCollections(String sourceUri, ServiceManager manager) throws ServiceException, MalformedURLException, IOException(Code) | | Deletes all empty collections in a subtree.
Parameters: sourceUri - The root source URI. Parameters: manager - The service manager. throws: ServiceException - throws: MalformedURLException - throws: IOException - |
exists | public static boolean exists(String sourceUri, ServiceManager manager) throws ServiceException, MalformedURLException, IOException(Code) | | Checks if a source exists.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. A boolean value. throws: ServiceException - if an error occurs. throws: MalformedURLException - if an error occurs. throws: IOException - if an error occurs. |
getLastModified | public static long getLastModified(String sourceUri, ServiceManager manager) throws ServiceException, MalformedURLException, IOException(Code) | | Returns the last modification date of a source.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. A long value. throws: ServiceException - if an error occurs. throws: MalformedURLException - if an error occurs. throws: IOException - if an error occurs. |
lock | public static void lock(String sourceUri, ServiceManager manager) throws RepositoryException(Code) | | Locks a transactionable source.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. throws: RepositoryException - If an error occurs. |
registerDirty | public static void registerDirty(String sourceUri, ServiceManager manager)(Code) | | Registers a source as dirty.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. |
unlock | public static void unlock(String sourceUri, ServiceManager manager) throws RepositoryException(Code) | | Unlocks a transactionable source.
Parameters: sourceUri - The source URI. Parameters: manager - The service manager. throws: RepositoryException - If an error occurs. |
|
|