You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Todd Kuebler <tk...@cisco.com> on 2002/04/19 02:18:01 UTC

Disk Cache temp directory change proposal

Proposal:

The servlet container provides a temp directory for things like jsp 
compilation etc.  I propose Jetspeed be configurable to use this location 
for all filewriting activity if desired.  I've included a diff for a change 
to the JetspeedDiskCache.java implementation to support this functionality 
for the Disk Cache if the JetspeedResources.properties entry 
'cache.directory' is either missing entirely or equal to null.



Index: JetspeedDiskCache.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/cache/disk/JetspeedDiskCache
.java,v
retrieving revision 1.42
diff -r1.42 JetspeedDiskCache.java
1c1
< /* ====================================================================
---
 >  /* ====================================================================
69a70
 > import javax.servlet.*;
72a74
 > import org.apache.turbine.services.servlet.TurbineServlet;
448,449c450,465
<         return JetspeedDiskCache.getInstance( DEFAULT_CACHE_DIRECTORY );
<
---
 >       if ( DEFAULT_CACHE_DIRECTORY == null) {
 >             String tempdir = new String("WEB-INF/cache"); // should 
never happen, but just in case.
 >             try {
 >                 ServletContext sc = TurbineServlet.getServletContext();
 >                 tempdir = 
sc.getAttribute("javax.servlet.context.tempdir").toString() + 
"/jetspeed/cache";
 >                 Log.debug("DISK CACHE: will create cache in servlet temp 
directory " +  tempdir);
 >             } catch (Exception e) {
 >                 Log.info("DISK CACHE: problems creating cache in servlet 
temp directory "
 >                            + " falling back to WEB-INF/cache : " + e);
 >             }
 >             return JetspeedDiskCache.getInstance( tempdir );
 >       } else {
 >             Log.debug("DISK CACHE: will create cache in user configured 
" + DEFAULT_CACHE_DIRECTORY);
 >             // should test for writability here and fallback to servlet 
tmp directory on failure
 >             return JetspeedDiskCache.getInstance( DEFAULT_CACHE_DIRECTORY );
 >         }
 >


%regards -tk


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


RE: Disk Cache temp directory change proposal

Posted by Todd Kuebler <tk...@cisco.com>.
At 10:02 AM 4/19/2002 -0700, you wrote:
>Todd,
>
>I committed your patch, but rec'd some security errors during commit
>from cvs.
>Could you double check to see if the patch was applied

Yup, builds and tests fine at first glance.  Thanks.  :)


-tk


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


RE: Disk Cache temp directory change proposal

Posted by David Sean Taylor <da...@bluesunrise.com>.
Todd,

I committed your patch, but rec'd some security errors during commit
from cvs.
Could you double check to see if the patch was applied

Thanks,

David

> -----Original Message-----
> From: Todd Kuebler [mailto:tkuebler@cisco.com] 
> Sent: Thursday, April 18, 2002 9:57 PM
> To: Jetspeed Developers List
> Subject: RE: Disk Cache temp directory change proposal
> 
> 
> At 09:46 PM 4/18/2002 -0700, you wrote:
> >Can you send the diffs as an attachment, Im getting split 
> lines in my 
> >editor
> 
> 
> 
> -tk
> 



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


RE: Disk Cache temp directory change proposal

Posted by Todd Kuebler <tk...@cisco.com>.
At 09:46 PM 4/18/2002 -0700, you wrote:
>Can you send the diffs as an attachment, Im getting split lines in my
>editor



-tk

RE: Disk Cache temp directory change proposal

Posted by David Sean Taylor <da...@bluesunrise.com>.
Can you send the diffs as an attachment, Im getting split lines in my
editor



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