public final class FileContentImpl extends Object implements FileContent
FileContent
based on an actual file.Modifier and Type | Field and Description |
---|---|
String |
contentType
The content type of the above file.
|
File |
file
The underlying file.
|
Constructor and Description |
---|
FileContentImpl(File file)
Constructs a file content object based on specified file and
having a
null content type. |
FileContentImpl(File file,
String contentType)
Constructs a file content object based on specified file and
having specified content type.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Returns the content type of this file content object.
|
InputStream |
getInputStream()
Returns an input stream allowing the read the contents of
this file content object.
|
String |
getName()
Returns the basename of this file content object.
|
long |
getSize()
Returns the size in bytes of this file content object.
|
public final File file
public final String contentType
null
.public FileContentImpl(File file)
null
content type.public String getName()
FileContent
null
if not applicable.getName
in interface FileContent
public String getContentType()
FileContent
null
if unknown.getContentType
in interface FileContent
public long getSize()
FileContent
getSize
in interface FileContent
public InputStream getInputStream() throws IOException
FileContent
getInputStream
in interface FileContent
IOException
- if an I/O error occurs.