|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.ozacc.mail.fetch.impl.sk_jp.AttachmentsExtractor
public class AttachmentsExtractor
添付ファイルを抽出するPartHandlerです。
MultipartUtility#process()呼び出し後にgetFileNames()によって、 添付ファイル名の配列を得ることができます。
ファイル名配列のindexを指定してその添付ファイルに対する InputStreamを得たり、渡されたOutputStreamに対して書き出すことができます。
フィールドの概要 | |
---|---|
static int |
MODE_IGNORE_INLINE
Content-Disposition: inline; パートはfilenameがあっても無視します。 |
static int |
MODE_IGNORE_MESSAGE
message/*のパートを無視します。 |
コンストラクタの概要 | |
---|---|
AttachmentsExtractor()
添付ファイル一覧を得るためのPartHandlerを作成します。 |
|
AttachmentsExtractor(int mode)
添付ファイル一覧を得るためのPartHandlerを作成します。 |
メソッドの概要 | |
---|---|
String |
getContentType(int index)
指定添付ファイルのContent-Typeを返します。 |
int |
getCount()
添付ファイル個数を返します。 |
String |
getFileName(int index)
指定添付ファイルのファイル名を返します。 |
String[] |
getFileNames()
添付ファイル名の配列を返します。 |
InputStream |
getInputStream(int index)
指定添付ファイルを読み込むストリームを返します。 |
int |
getSize(int index)
指定添付ファイルのサイズを返します。 |
static void |
main(String[] args)
|
boolean |
processPart(javax.mail.Part part,
javax.mail.internet.ContentType context)
MultipartUtility#process()から呼びだされるメソッドです。 |
void |
writeTo(int index,
OutputStream out)
指定添付ファイルを指定ストリームに書き出します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final int MODE_IGNORE_MESSAGE
public static final int MODE_IGNORE_INLINE
コンストラクタの詳細 |
---|
public AttachmentsExtractor()
public AttachmentsExtractor(int mode)
mode
- 動作モード。MODE_で始まる識別子をor指定します。メソッドの詳細 |
---|
public boolean processPart(javax.mail.Part part, javax.mail.internet.ContentType context) throws javax.mail.MessagingException, IOException
PartHandler
内の processPart
javax.mail.MessagingException
IOException
public int getCount()
public String[] getFileNames() throws javax.mail.MessagingException
添付ファイルが存在しない場合は空の配列を返します。
ファイル名は同一のものが複数存在する事もありえます。
javax.mail.MessagingException
public String getFileName(int index) throws javax.mail.MessagingException
javax.mail.MessagingException
public String getContentType(int index) throws javax.mail.MessagingException
javax.mail.MessagingException
public int getSize(int index) throws javax.mail.MessagingException
javax.mail.MessagingException
public InputStream getInputStream(int index) throws javax.mail.MessagingException, IOException
javax.mail.MessagingException
IOException
public void writeTo(int index, OutputStream out) throws javax.mail.MessagingException, IOException
javax.mail.MessagingException
IOException
public static void main(String[] args) throws Exception
Exception
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |