public class

FilePartSource

extends Object
implements PartSource
java.lang.Object
   ↳ com.ning.http.multipart.FilePartSource

Class Overview

This class is an adaptation of the Apache HttpClient implementationhttp://hc.apache.org/httpclient-3.x/

Summary

Public Constructors
FilePartSource(File file)
Constructor for FilePartSource.
FilePartSource(String fileName, File file)
Constructor for FilePartSource.
Public Methods
InputStream createInputStream()
Return a new java.io.FileInputStream for the current filename.
File getFile()
String getFileName()
Return the current filename
long getLength()
Return the length of the file
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.multipart.PartSource

Public Constructors

public FilePartSource (File file)

Constructor for FilePartSource.

Parameters
file the FilePart source File.
Throws
FileNotFoundException if the file does not exist or cannot be read

public FilePartSource (String fileName, File file)

Constructor for FilePartSource.

Parameters
fileName the file name of the FilePart
file the source File for the FilePart
Throws
FileNotFoundException if the file does not exist or cannot be read

Public Methods

public InputStream createInputStream ()

Return a new java.io.FileInputStream for the current filename.

Returns
  • the new input stream.
Throws
IOException If an IO problem occurs.

public File getFile ()

public String getFileName ()

Return the current filename

Returns
  • the filename.
See Also

public long getLength ()

Return the length of the file

Returns
  • the length of the file.
See Also