Class ApacheHttpClient4Executor.FileExposingFileEntity

java.lang.Object
org.apache.http.entity.AbstractHttpEntity
org.apache.http.entity.FileEntity
org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.FileExposingFileEntity
All Implemented Interfaces:
Cloneable, org.apache.http.HttpEntity
Enclosing class:
ApacheHttpClient4Executor

private static class ApacheHttpClient4Executor.FileExposingFileEntity extends org.apache.http.entity.FileEntity
We use FileEntity as the HttpEntity implementation when the request OutputStream has been saved to a File on disk (because it was too large to fit into memory see RestCFHttpClientExecutor#writeRequestBodyToOutputStream(ClientRequest)); however, we have to delete the File supporting the FileEntity, otherwise the disk will soon run out of space - remember that there can be very huge files, in GB range, processed on a regular basis - and FileEntity exposes its content File as a protected field. For the enclosing parent class ( ApacheHttpClient4Executor ) to be able to get a handle to this content File and delete it, this class expose the content File.
This class is private scoped to prevent access to this content File outside of the parent class.
  • Field Summary

    Fields inherited from class org.apache.http.entity.FileEntity

    file

    Fields inherited from class org.apache.http.entity.AbstractHttpEntity

    chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileExposingFileEntity(File pFile, String pContentType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) File
     

    Methods inherited from class org.apache.http.entity.FileEntity

    clone, getContent, getContentLength, isRepeatable, isStreaming, writeTo

    Methods inherited from class org.apache.http.entity.AbstractHttpEntity

    consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FileExposingFileEntity

      public FileExposingFileEntity(File pFile, String pContentType)
      Parameters:
      pFile - -
      pContentType - -
  • Method Details

    • getFile

      File getFile()
      Returns:
      - the content File enclosed by this FileEntity.