title: Is there a Java library to cache files?
body: <p>Is there are java library that will cache files to memory and disk?  Basically, I would like the library to cache the file to memory.  However, if the in memory cache gets larger than a certain threshhold, some of the files should be written to disk.</p>
  
  <p>Is there any Java library that will do this?</p>
  
  <p>Grae</p>
  
  <p>Update:</p>
  
  <p>Just a couple general comment.</p>
  
  <p>I am only going to using these files once. They are just temp files.  In a perfect world, I would keep them all in memory.  However, I think I would run out of memory.  What I guess I am really looking for is some sort of paging system.  That can keep me form running out of memory, but also allow me to avoid writting everyhting to disk.</p>