|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lenya.cms.cocoon.source.SourceUtil
public final class SourceUtil
Constructor Summary | |
---|---|
SourceUtil()
|
Method Summary | |
---|---|
static void |
checkin(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Checks in a transactionable source. |
static void |
checkout(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Checks out a repository source. |
static void |
copy(org.apache.avalon.framework.service.ServiceManager manager,
java.lang.String sourceUri,
java.lang.String destUri)
Copies a Source without buffering. |
static void |
copy(org.apache.excalibur.source.Source source,
org.apache.excalibur.source.ModifiableSource destination,
boolean useBuffer)
Copies one Source to another using a source buffer i.e. the source Source is buffered before it is copied to its final destination. |
static void |
copy(org.apache.excalibur.source.SourceResolver resolver,
java.lang.String sourceUri,
java.io.OutputStream destOutputStream)
|
static void |
copy(org.apache.excalibur.source.SourceResolver resolver,
java.lang.String sourceUri,
java.lang.String destUri)
Copies a Source without buffering. |
static void |
copy(org.apache.excalibur.source.SourceResolver resolver,
java.lang.String sourceUri,
java.lang.String destUri,
boolean useBuffer)
Copies one Source to another. |
static void |
delete(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Deletes a source if it exists. |
static void |
deleteEmptyCollections(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Deletes all empty collections in a subtree. |
static boolean |
exists(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Checks if a source exists. |
static long |
getContentLength(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
|
static long |
getLastModified(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Returns the last modification date of a source. |
static java.lang.String |
getMimeType(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
|
static void |
lock(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Locks a transactionable source. |
static org.w3c.dom.Document |
readDOM(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Reads a DOM from a source. |
static void |
registerDirty(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Registers a source as dirty. |
static void |
unlock(java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Unlocks a transactionable source. |
static void |
writeDOM(org.w3c.dom.Document document,
java.io.OutputStream oStream)
|
static void |
writeDOM(org.w3c.dom.Document document,
java.lang.String sourceUri,
org.apache.avalon.framework.service.ServiceManager manager)
Writes a DOM to a source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SourceUtil()
Method Detail |
---|
public static void copy(org.apache.excalibur.source.Source source, org.apache.excalibur.source.ModifiableSource destination, boolean useBuffer) throws java.io.IOException
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!!
source
- destination
- useBuffer
- If true, the source data will be read into a buffer
before it is written to the final destination.
java.io.IOException
- If an error occures.public static void copy(org.apache.excalibur.source.SourceResolver resolver, java.lang.String sourceUri, java.lang.String destUri, boolean useBuffer) throws java.io.IOException, org.apache.excalibur.source.SourceException
resolver
- The SourceResolver to use for lookin up Sources.sourceUri
- The source to be copied.destUri
- The URI to copy to.useBuffer
- If true, the source Source is buffered before copied to
the final destination.
java.io.IOException
- If an error occures.
org.apache.excalibur.source.SourceException
- If the destination is not modifiable.copy(Source, ModifiableSource, boolean)
public static void copy(org.apache.excalibur.source.SourceResolver resolver, java.lang.String sourceUri, java.lang.String destUri) throws java.io.IOException
resolver
- A SourceResolver instance.sourceUri
- The source URI to copy from.destUri
- The destination URI to copy to.
java.io.IOException
- If an error occures.copy(SourceResolver, String, String, boolean)
public static void copy(org.apache.avalon.framework.service.ServiceManager manager, java.lang.String sourceUri, java.lang.String destUri) throws java.io.IOException, org.apache.avalon.framework.service.ServiceException
manager
- A service manager.sourceUri
- The source URI to copy from.destUri
- The destination URI to copy to.
java.io.IOException
- If an error occures.
org.apache.avalon.framework.service.ServiceException
copy(SourceResolver, String, String, boolean)
public static org.w3c.dom.Document readDOM(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, org.apache.excalibur.source.SourceNotFoundException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
null
if the source does not exist.
org.apache.avalon.framework.service.ServiceException
- if an error occurs.
org.apache.excalibur.source.SourceNotFoundException
- if an error occurs.
javax.xml.parsers.ParserConfigurationException
- if an error occurs.
org.xml.sax.SAXException
- if an error occurs.
java.io.IOException
- if an error occurs.public static void writeDOM(org.w3c.dom.Document document, java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws javax.xml.transform.TransformerConfigurationException, javax.xml.transform.TransformerException, org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
document
- The document.sourceUri
- The source URI.manager
- The service manager.
javax.xml.transform.TransformerConfigurationException
- if an error occurs.
javax.xml.transform.TransformerException
- if an error occurs.
org.apache.avalon.framework.service.ServiceException
- if the source resolver could not be obtained.
java.net.MalformedURLException
- if the source URI is not valid.
java.io.IOException
- if an error occurs.public static void writeDOM(org.w3c.dom.Document document, java.io.OutputStream oStream) throws javax.xml.transform.TransformerConfigurationException, javax.xml.transform.TransformerException, java.io.IOException
document
- The XML document.oStream
- The output stream.
javax.xml.transform.TransformerConfigurationException
- if an error occurs.
javax.xml.transform.TransformerException
- if an error occurs.
java.io.IOException
- if an error occurs.public static void delete(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
- if an error occurs.
java.net.MalformedURLException
- if an error occurs.
java.io.IOException
- if an error occurs.public static void deleteEmptyCollections(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The root source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
java.net.MalformedURLException
java.io.IOException
public static boolean exists(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
- if an error occurs.
java.net.MalformedURLException
- if an error occurs.
java.io.IOException
- if an error occurs.public static long getLastModified(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
- if an error occurs.
java.net.MalformedURLException
- if an error occurs.
java.io.IOException
- if an error occurs.public static void checkout(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws RepositoryException, org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
RepositoryException
- If an error occurs.
org.apache.avalon.framework.service.ServiceException
- If an error occurs.
java.net.MalformedURLException
- If an error occurs.
java.io.IOException
- If an error occurs.public static void checkin(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws RepositoryException, org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
RepositoryException
- If an error occurs.
org.apache.avalon.framework.service.ServiceException
- If an error occurs.
java.net.MalformedURLException
- If an error occurs.
java.io.IOException
- If an error occurs.public static void lock(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws RepositoryException
sourceUri
- The source URI.manager
- The service manager.
RepositoryException
- If an error occurs.public static void unlock(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws RepositoryException
sourceUri
- The source URI.manager
- The service manager.
RepositoryException
- If an error occurs.public static void registerDirty(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager)
sourceUri
- The source URI.manager
- The service manager.public static long getContentLength(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
java.net.MalformedURLException
java.io.IOException
public static java.lang.String getMimeType(java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException, java.net.MalformedURLException, java.io.IOException
sourceUri
- The source URI.manager
- The service manager.
org.apache.avalon.framework.service.ServiceException
java.io.IOException
java.net.MalformedURLException
public static void copy(org.apache.excalibur.source.SourceResolver resolver, java.lang.String sourceUri, java.io.OutputStream destOutputStream) throws java.net.MalformedURLException, java.io.IOException
resolver
- sourceUri
- destOutputStream
-
java.net.MalformedURLException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |