Interface FileCacheable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close the FileCacheable, release all resources.
      long getLastModified()
      Returns the time that the underlying file(s) were last modified.
      String getLocation()
      The location of the FileCacheable.
      void reacquire()
      Reacquire any resources like file handles Used when reactivating in cache.
      void release()
      Release any system resources like file handles.
      void setFileCache​(FileCacheIF fileCache)
      If the FileCache is not null, FileCacheable.close() must call FileCache.release()
    • Method Detail

      • getLocation

        String getLocation()
        The location of the FileCacheable. This must be sufficient for FileFactory.factory() to create the FileCacheable object
        Returns:
        location
      • close

        void close()
            throws IOException
        Close the FileCacheable, release all resources. Must call cache.release(this) if cache is not null.
        Throws:
        IOException - on io error
      • getLastModified

        long getLastModified()
        Returns the time that the underlying file(s) were last modified. If they've changed since they were stored in the cache, they will be closed and reopened with FileFactory.
        Returns:
        a long value representing the time the file(s) were last modified or 0L if the last-modified time couldn't be determined for any reason.
      • setFileCache

        void setFileCache​(FileCacheIF fileCache)
        If the FileCache is not null, FileCacheable.close() must call FileCache.release()
         public synchronized void close() throws java.io.IOException {
           if (cache != null) {
             if (cache.release(this))
               return;
           }
         
           reallyClose();
         }
         
        Parameters:
        fileCache - must store this, use it on close as above.
      • release

        void release()
              throws IOException
        Release any system resources like file handles. Optional, implement only if you are able to reacquire. Used when object is made inactive in cache.
        Throws:
        IOException
      • reacquire

        void reacquire()
                throws IOException
        Reacquire any resources like file handles Used when reactivating in cache.
        Throws:
        IOException