tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kavanagh <...@dotech.com>
Subject file access (security?)
Date Wed, 03 Apr 2002 04:07:13 GMT
I'm having a problem with TC4.0.3 (Win2K, JDK1.3.1)
I have some code that reads a property file and tries to load fonts 
listed within. ClassLoader.getResource() is used to locate the prop file 
and font files
I'm attaching the servlet test code. This code works fine under TC3.2.2 
and TC3.3a
BTW, the files being loaded are in a jar in my WEB-INF/lib directory.

I've seen two problems:
1. when the font path contains a space, the resource URL is OK, but 
calling url.openStream() returns null. (works fine in TC3.x)
2. even if the input stream is good (as shown in the log below), there 
seems to be a problem creating a temp file.

Could problem 2 be caused by some security features that have been put 
in place sincee TC3?

Here is my catalina.out (the relavent section)

file = fonts/Pgl_____.ttf
resource = 
jar:file:D:/work/pix.light/light/WEB-INF/lib/fonts.jar!/fonts/Pgl_____.ttf
input stream = java.util.zip.ZipFile$1@5dd910
java.io.IOException: The system cannot find the path specified
    at java.io.Win32FileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1162)
    at java.io.File.createTempFile(File.java:1247)
    at java.awt.Font.createFont(Font.java:398)
    at com.xerox.pix.servlet.FontServlet.doGet(FontServlet.java:41)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
...

Thanks,

    David

Mime
View raw message