tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42157] New: - URLs returned by ServletContext.getResource() cannot resolve, directories cannot be browsed...
Date Wed, 18 Apr 2007 11:15:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42157>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42157

           Summary: URLs returned by ServletContext.getResource() cannot
                    resolve, directories cannot be browsed...
           Product: Tomcat 5
           Version: 5.5.23
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: rui.damas@gmail.com


The URLs returned by ServletContext.getResource(String) cannot resolve, ie...

URL url = getResource("/WEB-INF/");
// url = "jndi:/servername//WEB-INF/"
URI uri = url.toURI().resolve("aFile.txt");
// uri = "jndi:/servername/WEB-INF/"
// misses the double slash and
uri.toURL().openStream();
// will fail

// noticed also...
URLConnection c = url.openConnection();
c.getInputStream();
// should return a stream containing the lits of files
// (like for the "file" protocol)
// so that directories can be browsed and add to URL.
// and...
c.getContentType();
// could return some special content type so that 
// files can be ditinguished from directories or
// maybe something like...
Boolean.parse(c.getRequestProperty("is-directory"));

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message