Package fi.iki.elonen

Class NanoHTTPD.DefaultTempFile

  • All Implemented Interfaces:
    NanoHTTPD.TempFile
    Enclosing class:
    NanoHTTPD

    public static class NanoHTTPD.DefaultTempFile
    extends java.lang.Object
    implements NanoHTTPD.TempFile
    Default strategy for creating and cleaning up temporary files.

    By default, files are created by File.createTempFile() in the directory specified.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private java.io.OutputStream fstream  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultTempFile​(java.io.File tempdir)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete()  
      java.lang.String getName()  
      java.io.OutputStream open()  
      • Methods inherited from class java.lang.Object

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

      • file

        private final java.io.File file
      • fstream

        private final java.io.OutputStream fstream
    • Constructor Detail

      • DefaultTempFile

        public DefaultTempFile​(java.io.File tempdir)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • delete

        public void delete()
                    throws java.lang.Exception
        Specified by:
        delete in interface NanoHTTPD.TempFile
        Throws:
        java.lang.Exception
      • open

        public java.io.OutputStream open()
                                  throws java.lang.Exception
        Specified by:
        open in interface NanoHTTPD.TempFile
        Throws:
        java.lang.Exception