Class WeakDataFile


  • final class WeakDataFile
    extends java.lang.ref.WeakReference<DataFile>
    Removing files based on this article
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private static boolean hasCleanUpExecutor  
      private static java.util.logging.Logger LOGGER  
      private java.io.RandomAccessFile raf  
      private static java.util.List<WeakDataFile> refList  
      private static java.lang.ref.ReferenceQueue<DataFile> refQueue  
      private static int TIMEOUT  
    • Constructor Summary

      Constructors 
      Constructor Description
      WeakDataFile​(DataFile df, java.io.File file)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void close()  
      (package private) static void drainRefQueueBounded()  
      (package private) void read​(long pointer, byte[] buf, int offset, int length)  
      (package private) void renameTo​(java.io.File f)  
      (package private) long writeTo​(long pointer, byte[] data, int offset, int length)  
      • Methods inherited from class java.lang.ref.Reference

        clear, clone, enqueue, get, isEnqueued, reachabilityFence
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • TIMEOUT

        private static int TIMEOUT
      • refQueue

        private static java.lang.ref.ReferenceQueue<DataFile> refQueue
      • refList

        private static java.util.List<WeakDataFile> refList
      • file

        private final java.io.File file
      • raf

        private final java.io.RandomAccessFile raf
      • hasCleanUpExecutor

        private static boolean hasCleanUpExecutor
    • Constructor Detail

      • WeakDataFile

        WeakDataFile​(DataFile df,
                     java.io.File file)
    • Method Detail

      • read

        void read​(long pointer,
                  byte[] buf,
                  int offset,
                  int length)
      • writeTo

        long writeTo​(long pointer,
                     byte[] data,
                     int offset,
                     int length)
      • close

        void close()
      • renameTo

        void renameTo​(java.io.File f)
      • drainRefQueueBounded

        static void drainRefQueueBounded()