xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@locus.apache.org
Subject cvs commit: xml-stylebook/src/org/apache/stylebook StyleBook.java URLHandler.java
Date Wed, 01 Dec 1999 14:21:27 GMT
pier        99/12/01 06:21:27

  Modified:    docs     run.bat
               src/org/apache/stylebook StyleBook.java URLHandler.java
  Log:
  Removed all code added to support sbk:/entities (caused more problems than it solved).
  
  Revision  Changes    Path
  1.4       +1 -1      xml-stylebook/docs/run.bat
  
  Index: run.bat
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/docs/run.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- run.bat	1999/12/01 14:02:13	1.3
  +++ run.bat	1999/12/01 14:21:27	1.4
  @@ -1,2 +1,2 @@
   @echo off
  -java org.apache.stylebook.StyleBook "targetDirectory=targets" sources/book.xml styles/ibm/
  +java org.apache.stylebook.StyleBook "targetDirectory=targets" sources/book.xml styles/apachexml
  
  
  
  1.4       +2 -5      xml-stylebook/src/org/apache/stylebook/StyleBook.java
  
  Index: StyleBook.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/StyleBook.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StyleBook.java	1999/12/01 06:00:35	1.3
  +++ StyleBook.java	1999/12/01 14:21:27	1.4
  @@ -21,7 +21,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.3 $ $Date: 1999/12/01 06:00:35 $
  + * @version CVS $Revision: 1.4 $ $Date: 1999/12/01 14:21:27 $
    */
   public class StyleBook implements Logger {
       /** The project on wich we must operate */
  @@ -66,10 +66,7 @@
           if(style==null) exit("Style file non specified",1);
           File projectFile=new File(project);
           File styleFile=new File(style);
  -        File entitiesFile=null;
  -        String entities=this.properties.getProperty("entitiesFile");
  -        if (entities!=null) entitiesFile=new File(entities);
  -        URLHandler u=new URLHandler(projectFile,styleFile,entitiesFile);
  +        URLHandler u=new URLHandler(projectFile,styleFile);
           URL.setURLStreamHandlerFactory(u);
           this.project=new URL("sbk:/sources/"+projectFile.getName());
           log("Project URL: \""+this.project+"\"");
  
  
  
  1.3       +5 -20     xml-stylebook/src/org/apache/stylebook/URLHandler.java
  
  Index: URLHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/URLHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- URLHandler.java	1999/12/01 06:00:35	1.2
  +++ URLHandler.java	1999/12/01 14:21:27	1.3
  @@ -26,18 +26,17 @@
    * @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.2 $ $Date: 1999/12/01 06:00:35 $
  + * @version CVS $Revision: 1.3 $ $Date: 1999/12/01 14:21:27 $
    */
   public class URLHandler implements URLStreamHandlerFactory {
       private URL sty=null;
       private URL src=null;
  -    private URL ent=null;
       
       public URLHandler() {
           super();
       }
   
  -    public URLHandler(File sources, File style, File entities)
  +    public URLHandler(File sources, File style)
       throws IOException {
           super();
           if (sources==null) throw new IOException("Null Sources");
  @@ -51,24 +50,16 @@
               this.sty=new URL("jar:"+style.getCanonicalFile().toURL()+"!/");
           } else throw new IOException("Style File/Directory not found");
   
  -        if (sources.isDirectory()) {
  +        if (sources.isFile()) {
               this.src=sources.getCanonicalFile().toURL();
  -        } else if (sources.isFile()) {
  -            this.src=sources.getCanonicalFile().getParentFile().toURL();
           } else throw new IOException("Sources File/Directory not found");
  -
  -        if (entities!=null) {
  -            if (sources.isFile()) {
  -                this.ent=entities.getCanonicalFile().toURL();
  -            } else throw new IOException("Entity File not found");
  -        }
       }
       
       public URLStreamHandler createURLStreamHandler(String protocol) {
           if (protocol==null) return(null);
           try {
               if (protocol.equalsIgnoreCase("sbk"))
  -                return(new StylebookStreamHandler(this.sty,this.src,this.ent));
  +                return(new StylebookStreamHandler(this.sty,this.src));
               if (protocol.equalsIgnoreCase("res"))
                   return(new ResourceStreamHandler());
               else return(null);
  @@ -80,20 +71,16 @@
       private class StylebookStreamHandler extends URLStreamHandler {
           private URL style=null;
           private URL sources=null;
  -        private URL entities=null;
   
           private StylebookStreamHandler() {
               super();
           }
   
  -        private StylebookStreamHandler(URL style, URL sources, URL entities)
  +        private StylebookStreamHandler(URL style, URL sources)
           throws IOException {
               this();
               this.style=style;
               this.sources=sources;
  -            if (entities==null)
  -                entities=new URL("res:/org/apache/stylebook/data/entities.xml");
  -            this.entities=entities;
           }
   
           public URLConnection openConnection(URL u) throws IOException {
  @@ -109,8 +96,6 @@
               } else if (file.startsWith("sources/")) {
                   if (file.length()==8) return(this.sources.openConnection());
                   return new URL(this.sources,file.substring(8)).openConnection();
  -            } else if (file.equals("entities")) {
  -                return(this.entities.openConnection());
               } else throw new IOException("Invalid StyleBook URL \""+u+"\"");
           }
       }
  
  
  

Mime
View raw message