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-sandbox/jelly/src/java/org/apache/commons/jelly/tags/util AvailableTag.java
Date Sat, 21 Dec 2002 03:06:54 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message