I'm trying to get a jndi URL to a local directory from JetspeedResources.
Ultimately this URL is to be used to read the contents of files from that
directory (using JetspeedDiskCache.getEntry()).
In JetspeedResources.properties I have:
mydir.url=/WEB-INF/mydir/staticfiles/
In the code I then do:
String dir = JetspeedResources.getString("mydir.url");
dir = TurbineServlet.getRealPath(dir);
dir += "somestaticfile.txt";
// at this stage dir is the full path to the directory
(c:\tomcat\jetspeed\WEB-INF\mydir\etc)
URL url = new URL(dir);
Reader rdr = JetspeedDiskCache.getInstance()
.getEntry( url.toString() ).getReader();
// then read file contents
---------------
My problem is in converting the path to a URL. I would normally read the URL
from a portlet's URL property (which is then of protocol "jndi") but I'm now
using an ActionEvent and don't have any other way of specifing the dir path.
Is there a neat way of getting a URL from a dir path, that can be used in
the JetspeedDiskCache.getEntry(), i.e with the JNDI protocol?
Regards
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]