com.ning.http.multipart
Interface PartSource

All Known Implementing Classes:
ByteArrayPartSource, FilePartSource

public interface PartSource

This class is an adaptation of the Apache HttpClient implementation


Method Summary
 InputStream createInputStream()
          Gets a new InputStream for reading this source.
 String getFileName()
          Gets the name of the file this source represents.
 long getLength()
          Gets the number of bytes contained in this source.
 

Method Detail

getLength

long getLength()
Gets the number of bytes contained in this source.

Returns:
a value >= 0

getFileName

String getFileName()
Gets the name of the file this source represents.

Returns:
the fileName used for posting a MultiPart file part

createInputStream

InputStream createInputStream()
                              throws IOException
Gets a new InputStream for reading this source. This method can be called more than once and should therefore return a new stream every time.

Returns:
a new InputStream
Throws:
IOException - if an error occurs when creating the InputStream


Copyright © 2011. All Rights Reserved.