Class FilePartSource
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.FilePartSource
- All Implemented Interfaces:
PartSource
A PartSource that reads from a File.
- Since:
- 2.0
-
Constructor Summary
ConstructorDescriptionFilePartSource
(File file) Constructor for FilePartSource.FilePartSource
(String fileName, File file) Constructor for FilePartSource. -
Method Summary
Modifier and TypeMethodDescriptionReturn a newFileInputStream
for the current filename.Return the current filenamelong
Return the length of the file
-
Constructor Details
-
FilePartSource
Constructor for FilePartSource.- Parameters:
file
- the FilePart source File.- Throws:
FileNotFoundException
- if the file does not exist or cannot be read
-
FilePartSource
Constructor for FilePartSource.- Parameters:
fileName
- the file name of the FilePartfile
- the source File for the FilePart- Throws:
FileNotFoundException
- if the file does not exist or cannot be read
-
-
Method Details
-
getLength
public long getLength()Return the length of the file- Specified by:
getLength
in interfacePartSource
- Returns:
- the length of the file.
- See Also:
-
getFileName
Return the current filename- Specified by:
getFileName
in interfacePartSource
- Returns:
- the filename.
- See Also:
-
createInputStream
Return a newFileInputStream
for the current filename.- Specified by:
createInputStream
in interfacePartSource
- Returns:
- the new input stream.
- Throws:
IOException
- If an IO problem occurs.- See Also:
-