Class PartialFile

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    final class PartialFile
    extends java.lang.Object
    implements java.io.Closeable
    A partially downloaded file with optional support for resume. If resume is enabled, a well-known location is used for the partial file in combination with a lock file to prevent concurrent requests from corrupting it (and wasting network bandwith). Otherwise, a (non-locked) unique temporary file is used.
    • Field Detail

      • partFile

        private final java.io.File partFile
      • threshold

        private final long threshold
      • LOGGER

        private static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • PartialFile

        private PartialFile​(java.io.File partFile)
      • PartialFile

        private PartialFile​(java.io.File partFile,
                            PartialFile.LockFile lockFile,
                            long threshold)
    • Method Detail

      • getFile

        public java.io.File getFile()
      • isResume

        public boolean isResume()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object