org.apache.http.entity
Class FileEntityHC4

java.lang.Object
  extended by org.apache.http.entity.AbstractHttpEntityHC4
      extended by org.apache.http.entity.FileEntityHC4
All Implemented Interfaces:
java.lang.Cloneable, org.apache.http.HttpEntity

@NotThreadSafe
public class FileEntityHC4
extends AbstractHttpEntityHC4
implements java.lang.Cloneable

A self contained, repeatable entity that obtains its content from a file.

Since:
4.0

Field Summary
protected  java.io.File file
           
 
Fields inherited from class org.apache.http.entity.AbstractHttpEntityHC4
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
 
Constructor Summary
FileEntityHC4(java.io.File file)
           
FileEntityHC4(java.io.File file, ContentType contentType)
           
FileEntityHC4(java.io.File file, java.lang.String contentType)
          Deprecated. (4.1.3) FileEntityHC4(File, ContentType)
 
Method Summary
 java.lang.Object clone()
           
 java.io.InputStream getContent()
           
 long getContentLength()
           
 boolean isRepeatable()
           
 boolean isStreaming()
          Tells that this entity is not streaming.
 void writeTo(java.io.OutputStream outstream)
           
 
Methods inherited from class org.apache.http.entity.AbstractHttpEntityHC4
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected final java.io.File file
Constructor Detail

FileEntityHC4

@Deprecated
public FileEntityHC4(java.io.File file,
                                java.lang.String contentType)
Deprecated. (4.1.3) FileEntityHC4(File, ContentType)


FileEntityHC4

public FileEntityHC4(java.io.File file,
                     ContentType contentType)
Since:
4.2

FileEntityHC4

public FileEntityHC4(java.io.File file)
Since:
4.2
Method Detail

isRepeatable

public boolean isRepeatable()
Specified by:
isRepeatable in interface org.apache.http.HttpEntity

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface org.apache.http.HttpEntity

getContent

public java.io.InputStream getContent()
                               throws java.io.IOException
Specified by:
getContent in interface org.apache.http.HttpEntity
Throws:
java.io.IOException

writeTo

public void writeTo(java.io.OutputStream outstream)
             throws java.io.IOException
Specified by:
writeTo in interface org.apache.http.HttpEntity
Throws:
java.io.IOException

isStreaming

public boolean isStreaming()
Tells that this entity is not streaming.

Specified by:
isStreaming in interface org.apache.http.HttpEntity
Returns:
false

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException