cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/source/impl FileSource.java
Date Thu, 06 Feb 2003 12:19:46 GMT
cziegeler    2003/02/06 04:19:46

  Modified:    src/java/org/apache/cocoon/components/source SourceUtil.java
                        WriteableSAXSource.java
               src/blocks/slide/java/org/apache/cocoon/acting
                        SourceMultiAction.java
               src/blocks/slide/java/org/apache/cocoon/components/source
                        ModifiableTraversableSource.java
                        TraversableSource.java
               src/blocks/slide/java/org/apache/cocoon/components/source/impl
                        SlideSource.java
               src/java/org/apache/cocoon/transformation
                        SourceWritingTransformer.java
               src/java/org/apache/cocoon/components/source/impl
                        FileSource.java
  Removed:     src/java/org/apache/cocoon/components/source
                        MoveableSource.java WriteableSource.java
  Log:
  Removing obsolete source interface that are now part of avalon excalibur
  
  Revision  Changes    Path
  1.21      +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- SourceUtil.java	31 Jan 2003 22:51:34 -0000	1.20
  +++ SourceUtil.java	6 Feb 2003 12:19:44 -0000	1.21
  @@ -65,6 +65,7 @@
   import org.apache.cocoon.xml.XMLUtils;
   import org.apache.cocoon.xml.dom.DOMBuilder;
   import org.apache.cocoon.xml.dom.DOMStreamer;
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceNotFoundException;
  @@ -399,8 +400,8 @@
           try {
               source = SourceUtil.getSource(location, typeParameters,
                                             parameters, resolver);
  -            if (source instanceof WriteableSource) {
  -                WriteableSource ws = (WriteableSource) source;
  +            if (source instanceof ModifiableSource) {
  +                ModifiableSource ws = (ModifiableSource) source;
   
                   frag.normalize();
   
  
  
  
  1.5       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/source/WriteableSAXSource.java
  
  Index: WriteableSAXSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/WriteableSAXSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WriteableSAXSource.java	31 Jan 2003 22:51:34 -0000	1.4
  +++ WriteableSAXSource.java	6 Feb 2003 12:19:44 -0000	1.5
  @@ -55,6 +55,7 @@
   
   package org.apache.cocoon.components.source;
   
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.SourceException;
   
   import org.xml.sax.ContentHandler;
  @@ -76,7 +77,7 @@
    * @version CVS $Id$
    */
   public interface WriteableSAXSource
  -    extends WriteableSource {
  +    extends ModifiableSource {
   
       /**
        * Get a <code>ContentHandler</code> where an XML document can
  
  
  
  1.3       +6 -6      xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/acting/SourceMultiAction.java
  
  Index: SourceMultiAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/acting/SourceMultiAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourceMultiAction.java	31 Jan 2003 22:49:32 -0000	1.2
  +++ SourceMultiAction.java	6 Feb 2003 12:19:45 -0000	1.3
  @@ -64,7 +64,6 @@
   import org.apache.cocoon.components.source.InspectableSource;
   import org.apache.cocoon.components.source.ModifiableTraversableSource;
   import org.apache.cocoon.components.source.RestrictableSource;
  -import org.apache.cocoon.components.source.WriteableSource;
   import org.apache.cocoon.components.source.helpers.GroupSourcePermission;
   import org.apache.cocoon.components.source.helpers.PrincipalSourcePermission;
   import org.apache.cocoon.components.source.helpers.SourceCredential;
  @@ -75,6 +74,7 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.SourceResolver;
   
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   
  @@ -146,8 +146,8 @@
                   if (source instanceof RestrictableSource)
                       ((RestrictableSource)source).setSourceCredential(new SourceCredential(principal,
password));
   
  -                if (source instanceof WriteableSource) {
  -                    WriteableSource writeablesource = (WriteableSource)source;
  +                if (source instanceof ModifiableSource) {
  +                    ModifiableSource writeablesource = (ModifiableSource)source;
   
                       OutputStream out = writeablesource.getOutputStream();
   
  @@ -243,8 +243,8 @@
               if (source instanceof RestrictableSource)
                   ((RestrictableSource)source).setSourceCredential(new SourceCredential(principal,
password));
   
  -            if (source instanceof WriteableSource) {
  -                WriteableSource writeablesource = (WriteableSource)source;
  +            if (source instanceof ModifiableSource) {
  +                ModifiableSource writeablesource = (ModifiableSource)source;
   
                   writeablesource.delete();
   
  
  
  
  1.2       +6 -2      xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/ModifiableTraversableSource.java
  
  Index: ModifiableTraversableSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/ModifiableTraversableSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModifiableTraversableSource.java	31 Jan 2003 18:08:43 -0000	1.1
  +++ ModifiableTraversableSource.java	6 Feb 2003 12:19:45 -0000	1.2
  @@ -55,16 +55,20 @@
   
   package org.apache.cocoon.components.source;
   
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.SourceException;
   
   /**
    * A source, which can be a directory or collection of sources, which can
    * can be modfied.
    *
  + * WARNING: Do not use this interface, it will be removed soon. Use
  + *          the version from avalon excalibur instead.
  + * 
    * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version $Id$
    */
  -public interface ModifiableTraversableSource extends TraversableSource, WriteableSource
{
  +public interface ModifiableTraversableSource extends TraversableSource, ModifiableSource
{
   
       /**
        * Create a collection of sources.
  
  
  
  1.2       +4 -1      xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/TraversableSource.java
  
  Index: TraversableSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/TraversableSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TraversableSource.java	31 Jan 2003 18:08:43 -0000	1.1
  +++ TraversableSource.java	6 Feb 2003 12:19:45 -0000	1.2
  @@ -61,6 +61,9 @@
   /**
    * A source, which can be a directory or collection of sources.
    *
  + * WARNING: Do not use this interface, it will be removed soon. Use
  + *          the version from avalon excalibur instead.
  + * 
    * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version $Id$
    */
  
  
  
  1.3       +7 -5      xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/impl/SlideSource.java
  
  Index: SlideSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/slide/java/org/apache/cocoon/components/source/impl/SlideSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SlideSource.java	31 Jan 2003 22:49:32 -0000	1.2
  +++ SlideSource.java	6 Feb 2003 12:19:45 -0000	1.3
  @@ -75,6 +75,8 @@
   import org.apache.cocoon.components.source.helpers.SourceLock;
   import org.apache.cocoon.components.source.helpers.SourcePermission;
   import org.apache.cocoon.components.source.helpers.SourceProperty;
  +import org.apache.excalibur.source.ModifiableSource;
  +import org.apache.excalibur.source.MoveableSource;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceValidity;
  @@ -104,7 +106,7 @@
    * @version $Id$
    */
   public class SlideSource extends AbstractLogEnabled
  -  implements Contextualizable, Source, WriteableSource,
  +  implements Contextualizable, Source, ModifiableSource,
                ModifiableTraversableSource, MoveableSource, RestrictableSource,
                LockableSource, InspectableSource, VersionableSource {
   
  @@ -622,14 +624,14 @@
       /**
        * Delete the source.
        *
  -     * @throws SourceException If the source could not be deleted.
        */
  -    public void delete() throws SourceException {
  +    public boolean delete() {
           try {
               this.macro.delete(slideToken,
                                 this.config.getFilesPath()+this.path);
  +            return true;
           } catch (SlideException se) {
  -            throw new SourceException("Could not delete source.", se);
  +            return false;
           }
       }
   
  
  
  
  1.17      +3 -3      xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java
  
  Index: SourceWritingTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SourceWritingTransformer.java	31 Jan 2003 22:51:57 -0000	1.16
  +++ SourceWritingTransformer.java	6 Feb 2003 12:19:46 -0000	1.17
  @@ -59,12 +59,12 @@
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.components.source.WriteableSAXSource;
  -import org.apache.cocoon.components.source.WriteableSource;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.serialization.Serializer;
   import org.apache.cocoon.xml.XMLUtils;
   import org.apache.cocoon.xml.dom.DOMStreamer;
   import org.apache.cocoon.xml.dom.DOMUtil;
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.xml.dom.DOMParser;
  @@ -626,10 +626,10 @@
           String target = systemID;
           try {
               source = this.resolver.resolveURI( systemID );
  -            if ( ! (source instanceof WriteableSource)) {
  +            if ( ! (source instanceof ModifiableSource)) {
                   throw new ProcessingException("Source '"+systemID+"' is not writeable.");
               }
  -            WriteableSource ws = (WriteableSource)source;
  +            ModifiableSource ws = (ModifiableSource)source;
               exists = ws.exists();
               target = source.getURI();
               if ( exists == true && this.state == STATE_INSERT ) {
  
  
  
  1.11      +5 -6      xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSource.java
  
  Index: FileSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSource.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FileSource.java	30 Jan 2003 07:17:54 -0000	1.10
  +++ FileSource.java	6 Feb 2003 12:19:46 -0000	1.11
  @@ -62,7 +62,7 @@
   import java.util.ConcurrentModificationException;
   import java.util.Map;
   
  -import org.apache.cocoon.components.source.WriteableSource;
  +import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.impl.URLSource;
   
  @@ -76,7 +76,7 @@
   
   public class FileSource
       extends URLSource
  -    implements WriteableSource {
  +    implements ModifiableSource {
   
       /**
        * Initialize a new object from a <code>URL</code>.
  @@ -253,8 +253,7 @@
       /**
        * Delete the source.
        */
  -    public void delete() throws SourceException {
  -        if (!this.file.delete())
  -            throw new SourceException("Could not delete source '"+this.file.getPath()+"'");
  +    public boolean delete()  {
  +        return this.file.delete();
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message