Class DefaultHttpDataFactory

java.lang.Object
io.netty.handler.codec.http.multipart.DefaultHttpDataFactory
All Implemented Interfaces:
HttpDataFactory

public class DefaultHttpDataFactory extends Object implements HttpDataFactory
Default factory giving Attribute and FileUpload according to constructor.

According to the constructor, Attribute and FileUpload can be:

  • MemoryAttribute, DiskAttribute or MixedAttribute
  • MemoryFileUpload, DiskFileUpload or MixedFileUpload
A good example of releasing HttpData once all work is done is as follow:

   for (InterfaceHttpData httpData: decoder.getBodyHttpDatas()) {
     httpData.release();
     factory.removeHttpDataFromClean(request, httpData);
   }
   factory.cleanAllHttpData();
   decoder.destroy();
  
  • Field Details

    • MINSIZE

      public static final long MINSIZE
      Proposed default MINSIZE as 16 KB.
      See Also:
    • MAXSIZE

      public static final long MAXSIZE
      Proposed default MAXSIZE = -1 as UNLIMITED
      See Also:
  • Constructor Details

    • DefaultHttpDataFactory

      public DefaultHttpDataFactory()
      HttpData will be in memory if less than default size (16KB). The type will be Mixed.
    • DefaultHttpDataFactory

      public DefaultHttpDataFactory(Charset charset)
    • DefaultHttpDataFactory

      public DefaultHttpDataFactory(boolean useDisk)
      HttpData will be always on Disk if useDisk is True, else always in Memory if False
    • DefaultHttpDataFactory

      public DefaultHttpDataFactory(boolean useDisk, Charset charset)
    • DefaultHttpDataFactory

      public DefaultHttpDataFactory(long minSize)
      HttpData will be on Disk if the size of the file is greater than minSize, else it will be in memory. The type will be Mixed.
    • DefaultHttpDataFactory

      public DefaultHttpDataFactory(long minSize, Charset charset)
  • Method Details