org.apache.lenya.cms.cocoon.source
Class SourceUtil

java.lang.Object
  extended by org.apache.lenya.cms.cocoon.source.SourceUtil

public final class SourceUtil
extends java.lang.Object

Version:
$Id: SourceUtil.java 473841 2006-11-12 00:46:38Z gregor $

Constructor Summary
SourceUtil()
           
 
Method Summary
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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceUtil

public SourceUtil()
Method Detail

copy

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!!

Parameters:
source -
destination -
useBuffer - If true, the source data will be read into a buffer before it is written to the final destination.
Throws:
java.io.IOException - If an error occures.

copy

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
Copies one Source to another. The source Source is optionally buffered.

Parameters:
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.
Throws:
java.io.IOException - If an error occures.
org.apache.excalibur.source.SourceException - If the destination is not modifiable.
See Also:
copy(Source, ModifiableSource, boolean)

copy

public static void copy(org.apache.excalibur.source.SourceResolver resolver,
                        java.lang.String sourceUri,
                        java.lang.String destUri)
                 throws java.io.IOException
Copies a Source without buffering.

Parameters:
resolver - A SourceResolver instance.
sourceUri - The source URI to copy from.
destUri - The destination URI to copy to.
Throws:
java.io.IOException - If an error occures.
See Also:
copy(SourceResolver, String, String, boolean)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.