public class CachedFileDataSource extends javax.activation.FileDataSource implements SizeAwareDataSource
Constructor and Description |
---|
CachedFileDataSource(File file) |
Modifier and Type | Method and Description |
---|---|
String |
getContentType() |
long |
getSize()
Get the size of the data source.
|
void |
setContentType(String contentType) |
getFile, getInputStream, getName, getOutputStream, setFileTypeMap
public CachedFileDataSource(File file)
public String getContentType()
getContentType
in interface javax.activation.DataSource
getContentType
in class javax.activation.FileDataSource
public void setContentType(String contentType)
public long getSize()
SizeAwareDataSource
DataSource.getInputStream()
before reaching
the end of the stream. If the implementation is unable to determine the
size, it must return -1.getSize
in interface SizeAwareDataSource
Copyright © The Apache Software Foundation. All Rights Reserved.