Class FileTool.DeleteOnCloseInputStream

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

    public static class FileTool.DeleteOnCloseInputStream
    extends java.io.FileInputStream
    Custom FileInputFile with auto-deletion on close
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close stream and delete file
      • Methods inherited from class java.io.FileInputStream

        available, getChannel, getFD, read, read, read, skip
      • Methods inherited from class java.io.InputStream

        mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, transferTo
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeleteOnCloseInputStream

        public DeleteOnCloseInputStream​(java.io.File file)
                                 throws java.io.FileNotFoundException
        Constructor
        Parameters:
        file - File (that will be deleted on close)
        Throws:
        java.io.FileNotFoundException - If file is not found
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Close stream and delete file
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FileInputStream
        Throws:
        java.io.IOException