com.auxilii.msgparser.attachment
Class FileAttachment

Object
  extended by com.auxilii.msgparser.attachment.FileAttachment
All Implemented Interfaces:
Attachment

public class FileAttachment
extends Object
implements Attachment

Implementation of the 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.

Author:
roman.kurmanowytsch

Field Summary
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 Summary
FileAttachment()
           
 
Method Summary
 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(MessageProperty msgProp)
          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.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filename

protected String filename
The (by Outlook) shortened filename of the attachment.


longFilename

protected String longFilename
The full filename of the attachment.


mimeTag

protected String mimeTag
Mime type of the attachment


extension

protected String extension
The extension of the attachment (may not be set).


data

protected byte[] data
The attachment itself as a byte array.


size

protected long size
The size of the attachment.

Constructor Detail

FileAttachment

public FileAttachment()
Method Detail

getExtension

public String getExtension()
Returns:
the extension

setExtension

public void setExtension(String extension)
Parameters:
extension - the extension to set

getFilename

public String getFilename()
Returns:
the filename

setFilename

public void setFilename(String filename)
Parameters:
filename - the filename to set

getLongFilename

public String getLongFilename()
Returns:
the longFilename

setLongFilename

public void setLongFilename(String longFilename)
Parameters:
longFilename - the longFilename to set

getMimeTag

public String getMimeTag()
Returns:
the mimeTag

setMimeTag

public void setMimeTag(String mimeTag)
Parameters:
mimeTag - the mimeTag to set

getData

public byte[] getData()
Returns:
the data

setData

public void setData(byte[] data)
Parameters:
data - the data to set

getSize

public long getSize()
Returns:
the size

setSize

public void setSize(long size)
Parameters:
size - the size to set

setProperty

public void setProperty(MessageProperty msgProp)
                 throws ClassCastException
Sets the property specified by the name parameter. Unknown names are ignored.

Parameters:
msgProp - The property to be set.
Throws:
ClassCastException

toString

public String toString()
Returns either the long filename or the short filename, depending on which is available.

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007 Roman Kurmanowytsch