You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2002/12/21 04:06:54 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/util AvailableTag.java

dion        2002/12/20 19:06:54

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/util
                        AvailableTag.java
  Log:
  - Fix for failing test when the 'rootURL' directory contained spaces
  
  Revision  Changes    Path
  1.3       +9 -2      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/util/AvailableTag.java
  
  Index: AvailableTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/util/AvailableTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AvailableTag.java	11 Dec 2002 12:41:00 -0000	1.2
  +++ AvailableTag.java	21 Dec 2002 03:06:54 -0000	1.3
  @@ -59,6 +59,8 @@
   package org.apache.commons.jelly.tags.util;
   
   import java.io.File;
  +import java.io.IOException;
  +import java.io.InputStream;
   import java.net.URL;
   
   import org.apache.commons.jelly.TagSupport;
  @@ -91,8 +93,13 @@
       	else if (uri != null) {
       		URL url = context.getResource(uri);
       		String fileName = url.getFile();
  -    		File file = new File(fileName);
  -    		available = file.exists();
  +            try {
  +                InputStream is = url.openStream();
  +                available = (is != null);
  +                is.close();
  +            } catch (IOException ioe) {
  +                available = false;
  +            }
       	}
       	
       	if (available) {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>