Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.httpclient.methods.multipart
Class FilePartSource  view FilePartSource download FilePartSource.java

java.lang.Object
  extended byorg.apache.commons.httpclient.methods.multipart.FilePartSource
All Implemented Interfaces:
PartSource

public class FilePartSource
extends java.lang.Object
implements PartSource

A PartSource that reads from a File.

Since:
2.0

Field Summary
private  java.io.File file
          File part file.
private  java.lang.String fileName
          File part file name.
 
Constructor Summary
FilePartSource(java.io.File file)
          Constructor for FilePartSource.
FilePartSource(java.lang.String fileName, java.io.File file)
          Constructor for FilePartSource.
 
Method Summary
 java.io.InputStream createInputStream()
          Return a new java.io.FileInputStream for the current filename.
 java.lang.String getFileName()
          Return the current filename
 long getLength()
          Return the length of the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private java.io.File file
File part file.


fileName

private java.lang.String fileName
File part file name.

Constructor Detail

FilePartSource

public FilePartSource(java.io.File file)
               throws java.io.FileNotFoundException
Constructor for FilePartSource.


FilePartSource

public FilePartSource(java.lang.String fileName,
                      java.io.File file)
               throws java.io.FileNotFoundException
Constructor for FilePartSource.

Method Detail

getLength

public long getLength()
Return the length of the file

Specified by:
getLength in interface PartSource

getFileName

public java.lang.String getFileName()
Return the current filename

Specified by:
getFileName in interface PartSource

createInputStream

public java.io.InputStream createInputStream()
                                      throws java.io.IOException
Return a new java.io.FileInputStream for the current filename.

Specified by:
createInputStream in interface PartSource