public class FileAttachment extends Object implements Attachment
Attachment
interface that represents a file attachment.
It contains some useful information (as long
as it is available in the .msg file) like
the attachment name, its size, etc.Modifier and Type | Field and Description |
---|---|
protected byte[] |
data
The attachment itself as a byte array.
|
protected String |
extension
The extension of the attachment (may not
be set).
|
protected String |
filename
The (by Outlook) shortened filename of
the attachment.
|
protected String |
longFilename
The full filename of the attachment.
|
protected String |
mimeTag
Mime type of the attachment
|
protected long |
size
The size of the attachment.
|
Constructor and Description |
---|
FileAttachment() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getData() |
String |
getExtension() |
String |
getFilename() |
String |
getLongFilename() |
String |
getMimeTag() |
long |
getSize() |
void |
setData(byte[] data) |
void |
setExtension(String extension) |
void |
setFilename(String filename) |
void |
setLongFilename(String longFilename) |
void |
setMimeTag(String mimeTag) |
void |
setProperty(String name,
Object value,
org.apache.poi.poifs.filesystem.DocumentEntry de)
Sets the property specified by the name
parameter.
|
void |
setSize(long size) |
String |
toString()
Returns either the long filename or
the short filename, depending on which is available.
|
protected String filename
protected String longFilename
protected String mimeTag
protected String extension
protected byte[] data
protected long size
public String getExtension()
public void setExtension(String extension)
extension
- the extension to setpublic String getFilename()
public void setFilename(String filename)
filename
- the filename to setpublic String getLongFilename()
public void setLongFilename(String longFilename)
longFilename
- the longFilename to setpublic String getMimeTag()
public void setMimeTag(String mimeTag)
mimeTag
- the mimeTag to setpublic byte[] getData()
public void setData(byte[] data)
data
- the data to setpublic long getSize()
public void setSize(long size)
size
- the size to setpublic void setProperty(String name, Object value, org.apache.poi.poifs.filesystem.DocumentEntry de) throws ClassCastException
name
- The name of the property (i.e., the class
of the DocumentEntry
).value
- The value of the field.de
- The current DocumentEntry
.ClassCastException
public String toString()
toString
in class Object
Object.toString()
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.