You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by pi...@locus.apache.org on 2000/01/04 16:12:20 UTC

cvs commit: xml-stylebook/src/org/apache/stylebook/producers DirectoryProducer.java

pier        00/01/04 07:12:20

  Modified:    src/org/apache/stylebook/producers DirectoryProducer.java
  Log:
  These lines seems to break UNIX files (duplicating the name of the directory.
  Thanks to "Gerard van Enk" <ge...@eo.nl>
  
  Revision  Changes    Path
  1.2       +10 -5     xml-stylebook/src/org/apache/stylebook/producers/DirectoryProducer.java
  
  Index: DirectoryProducer.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/producers/DirectoryProducer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DirectoryProducer.java	1999/11/30 12:28:55	1.1
  +++ DirectoryProducer.java	2000/01/04 15:12:20	1.2
  @@ -25,7 +25,7 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
    *         Software Foundation</a>. All rights reserved.
  - * @version CVS $Revision: 1.1 $ $Date: 1999/11/30 12:28:55 $
  + * @version CVS $Revision: 1.2 $ $Date: 2000/01/04 15:12:20 $
    */
   public class DirectoryProducer extends AbstractComponent implements Producer {
       public Document produce(CreationContext c)
  @@ -39,10 +39,15 @@
           if (source.getProtocol().equals("file")) {
               // Trim the file name and open the directory
               String src=source.getFile();
  -            for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
  -                src=src.substring(x);
  -                break;
  -            }
  +            //
  +            // These lines seems to break UNIX files (duplicating the name
  +            // of the directory.
  +            // Thanks to "Gerard van Enk" <ge...@eo.nl>
  +            //
  +            //for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
  +            //    src=src.substring(x);
  +            //    break;
  +            //}
               File file=new File(src).getCanonicalFile();
               if (!file.isDirectory()) 
                   throw new CreationException(c.getSourceURL()+" ("+file+