com.openexchange.mail.uuencode
Class UUEncodedPart

java.lang.Object
  extended by com.openexchange.mail.uuencode.UUEncodedMultiPart
      extended by com.openexchange.mail.uuencode.UUEncodedPart

public class UUEncodedPart
extends UUEncodedMultiPart

UUEncodedPart - UUEncode part containing all needed information about the attachment.

Author:
Stefan Preuss, Thorben Betten

Method Summary
 javax.activation.DataHandler getDataHandler(java.lang.String contentType)
          Creates a data handler for this uuencoded part.
 java.lang.String getFileName()
          Return the filename attribute of the UUEncodedPart object
 int getFileSize()
          Return the file size attribute of the UUEncodedPart object.
 int getIndexEnd()
          Return the end position of the attachment within the content.
 int getIndexStart()
          Return the start position of the attachment within the content.
 java.io.InputStream getInputStream()
          Gets the inputStream attribute of the UUEncodedPart object
 java.lang.StringBuilder getPart()
          Gets the encoded part as StringBuffer
 void writeTo(java.io.OutputStream out)
          Output an appropriately encoded byte stream to the given OutputStream.
 
Methods inherited from class com.openexchange.mail.uuencode.UUEncodedMultiPart
getBodyPart, getCleanText, getCount, isUUEncoded, removeBodyPart
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileName

public java.lang.String getFileName()
Return the filename attribute of the UUEncodedPart object

Returns:
filename - The filename

getFileSize

public int getFileSize()
Return the file size attribute of the UUEncodedPart object. Note: This value may be different from the saved file. This is normal because this is the size of the raw (not encoded) object.

Returns:
The file size

getIndexStart

public int getIndexStart()
Return the start position of the attachment within the content.

Returns:
beginIndex - The start position

getIndexEnd

public int getIndexEnd()
Return the end position of the attachment within the content.

Returns:
beginIndex - The start position

getInputStream

public java.io.InputStream getInputStream()
Gets the inputStream attribute of the UUEncodedPart object

Returns:
inStreamPart - The inputStream

getDataHandler

public javax.activation.DataHandler getDataHandler(java.lang.String contentType)
Creates a data handler for this uuencoded part.

Parameters:
contentType - The content type to apply to data handler
Returns:
A data handler for this uuencoded part

getPart

public java.lang.StringBuilder getPart()
Gets the encoded part as StringBuffer

Returns:
The part

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Output an appropriately encoded byte stream to the given OutputStream.

Parameters:
out - - The inputStream
Throws:
java.io.IOException - if an error occurs writing to the stream