Package ball.activation
Class TempFileDataSource
- java.lang.Object
-
- ball.activation.AbstractDataSource
-
- ball.activation.TempFileDataSource
-
- All Implemented Interfaces:
DataSourceDefaultMethods,DataSource
public class TempFileDataSource extends AbstractDataSource
- Author:
- Allen D. Ball
-
-
Field Summary
-
Fields inherited from interface ball.activation.DataSourceDefaultMethods
APPLICATION_OCTET_STREAM, APPLICATION_XML, CONTENT_TYPE, TEXT_HTML, TEXT_PLAIN
-
-
Constructor Summary
Constructors Constructor Description TempFileDataSource(String type)TempFileDataSource(String prefix, String suffix, File parent, String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileInputStreamgetInputStream()FileOutputStreamgetOutputStream()longlength()Method to get the number of bytes stored inthisDataSource.-
Methods inherited from class ball.activation.AbstractDataSource
getContentType, getName, setContentType, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ball.activation.DataSourceDefaultMethods
clear, getInputStream, getOutputStream, wrap, wrap
-
-
-
-
Constructor Detail
-
TempFileDataSource
@ConstructorProperties({"","","","contentType"}) public TempFileDataSource(String prefix, String suffix, File parent, String type)
- Parameters:
prefix- The file name prefix.suffix- The file name suffix.parent- The parentFile.type- Initial"ContentType"attribute value.- See Also:
File.createTempFile(String,String,File)
-
TempFileDataSource
@ConstructorProperties("contentType") public TempFileDataSource(String type)
- Parameters:
type- Initial"ContentType"attribute value.
-
-
Method Detail
-
length
public long length()
Description copied from interface:DataSourceDefaultMethods- Returns:
- The number of bytes stored in
thisDataSource;-1if the count is unknown.
-
getInputStream
public FileInputStream getInputStream() throws IOException
- Throws:
IOException
-
getOutputStream
public FileOutputStream getOutputStream() throws IOException
- Throws:
IOException
-
-