public class FileAttachment extends java.lang.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 java.lang.String |
extension
The extension of the attachment (may not
be set).
|
protected java.lang.String |
filename
The (by Outlook) shortened filename of
the attachment.
|
protected java.lang.String |
longFilename
The full filename of the attachment.
|
protected java.lang.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() |
java.lang.String |
getExtension() |
java.lang.String |
getFilename() |
java.lang.String |
getLongFilename() |
java.lang.String |
getMimeTag() |
long |
getSize() |
void |
setData(byte[] data) |
void |
setExtension(java.lang.String extension) |
void |
setFilename(java.lang.String filename) |
void |
setLongFilename(java.lang.String longFilename) |
void |
setMimeTag(java.lang.String mimeTag) |
void |
setProperty(java.lang.String name,
java.lang.Object value,
org.apache.poi.poifs.filesystem.DocumentEntry de)
Sets the property specified by the name
parameter.
|
void |
setSize(long size) |
java.lang.String |
toString()
Returns either the long filename or
the short filename, depending on which is available.
|
protected java.lang.String filename
protected java.lang.String longFilename
protected java.lang.String mimeTag
protected java.lang.String extension
protected byte[] data
protected long size
public java.lang.String getExtension()
public void setExtension(java.lang.String extension)
extension
- the extension to setpublic java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename
- the filename to setpublic java.lang.String getLongFilename()
public void setLongFilename(java.lang.String longFilename)
longFilename
- the longFilename to setpublic java.lang.String getMimeTag()
public void setMimeTag(java.lang.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(java.lang.String name, java.lang.Object value, org.apache.poi.poifs.filesystem.DocumentEntry de) throws java.lang.ClassCastException
name
- The name of the property (i.e., the class
of the DocumentEntry
).value
- The value of the field.de
- The current DocumentEntry
.java.lang.ClassCastException
public java.lang.String toString()
toString
in class java.lang.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.