commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/jelly-tags/validate/src/java/org/apache/commons/jelly/tags/validate VerifierTag.java
Date Sun, 20 Apr 2003 04:06:41 GMT
dion        2003/04/19 21:06:40

  Modified:    jelly/jelly-tags/validate/src/java/org/apache/commons/jelly/tags/validate
                        VerifierTag.java
  Log:
  Add an option to load the schema from a file
  
  Revision  Changes    Path
  1.4       +25 -9     jakarta-commons/jelly/jelly-tags/validate/src/java/org/apache/commons/jelly/tags/validate/VerifierTag.java
  
  Index: VerifierTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/validate/src/java/org/apache/commons/jelly/tags/validate/VerifierTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VerifierTag.java	20 Apr 2003 03:16:24 -0000	1.3
  +++ VerifierTag.java	20 Apr 2003 04:06:40 -0000	1.4
  @@ -62,6 +62,8 @@
   package org.apache.commons.jelly.tags.validate;
   
   import java.io.ByteArrayInputStream;
  +import java.io.File;
  +import java.io.FileInputStream;
   import java.io.InputStream;
   import java.io.IOException;
   
  @@ -90,6 +92,9 @@
       /** The URI to load the schema from */
       private String uri;
       
  +    /** The file to load the schema from */
  +    private File file;
  +    
       /** The system ID to use when parsing the schema */
       private String systemId;
   
  @@ -109,8 +114,9 @@
               if ( in == null ) {
                   throw new JellyTagException( "Could not find resource for uri: " + uri
);
               }
  -        }
  -        else {
  +        } else if (file != null) {
  +        	in = new FileInputStream(file)
  +        } else {
               String text = getBodyText();
               in = new ByteArrayInputStream( text.getBytes() );
           }
  @@ -160,14 +166,24 @@
       }
   
       /**
  -     * Sets the URI of the schema file to parse. If no URI is specified then the
  -     * body of this tag is used as the source of the schema
  +     * Sets the URI of the schema file to parse. If no URI and no file is
  +     * specified then the body of this tag is used as the source of the schema
        * 
        * @jelly:optional
        */    
       public void setUri(String uri) {
           this.uri = uri;
       }
  +
  +	/**
  +	 * Sets the {@link File} of the schema to parse. If no URI and no file is
  +	 * specified then the body of this tag is used as the source of the schema
  +	 * 
  +	 * @jelly:optional
  +	 */    
  +	public void setFile(File aFile) {
  +		file = aFile;
  +	}
   
       /**
        * Sets the system ID used when parsing the schema
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message