intra-mart(R) 6.0.13

jp.co.intra_mart.foundation.http
クラス FileSender

java.lang.Object
  拡張jp.co.intra_mart.foundation.http.FileSender

public class FileSender
extends Object

このクラスは、HTTP レスポンスに対して指定のバイトをストリームとして 出力します。

関連項目:
HttpServletResponse

コンストラクタの概要
FileSender(HttpServletResponse httpResponse)
          HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。
FileSender(HttpServletResponse httpResponse, MultipurposeInternetMailExtensions mimeType)
          HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。
FileSender(HttpServletResponse httpResponse, MultipurposeInternetMailExtensions mimeType, String filename)
          HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。
FileSender(HttpServletResponse httpResponse, String filename)
          HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。
 
メソッドの概要
 void write(byte b)
          バイトの出力。
 void write(byte[] src)
          バイトの出力。
 void write(byte[] src, int off, int len)
          バイトの出力。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

FileSender

public FileSender(HttpServletResponse httpResponse)
           throws IOException
HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。

このコンストラクタでは、HTTP レスポンスヘッダの Content-Type および Content-Disposition の設定を自動的に行います。 その他のヘッダへの設定は httpResponse に対して 直接設定をしてください。
HTTP レスポンスヘッダの Content-Type には、MIME タイプとして application/octet-stream を指定します。
HTTP レスポンスヘッダの Content-Disposition は、以下のように定義します。
Content-Disposition: attachment

例外:
IOException - 入出力エラー

FileSender

public FileSender(HttpServletResponse httpResponse,
                  MultipurposeInternetMailExtensions mimeType)
           throws IOException
HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。

このコンストラクタでは、HTTP レスポンスヘッダの Content-Type および Content-Disposition の設定を自動的に行います。 その他のヘッダへの設定は httpResponse に対して 直接設定をしてください。
HTTP レスポンスヘッダの Content-Type には、MIME タイプとして 引数 mimeType の表す MIME タイプを設定します。

パラメータ:
mimeType - MIME タイプ
例外:
IOException - 入出力エラー

FileSender

public FileSender(HttpServletResponse httpResponse,
                  String filename)
           throws IOException
HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。

このコンストラクタでは、HTTP レスポンスヘッダの Content-Type および Content-Disposition の設定を自動的に行います。 その他のヘッダへの設定は httpResponse に対して 直接設定をしてください。
HTTP レスポンスヘッダの Content-Type には、MIME タイプとして 指定のファイル名にマップされている MIME を表す文字列か、または、 指定のファイル名にマップされている MIME タイプを解決できなかった 場合には application/octet-stream を指定します。
HTTP レスポンスヘッダの Content-Disposition は、以下のように定義します。
Content-Disposition: attachment; filename=ファイル名
“ファイル名”の部分には、引数 filename が設定されます。

パラメータ:
filename - ファイル名
例外:
IOException - 入出力エラー

FileSender

public FileSender(HttpServletResponse httpResponse,
                  MultipurposeInternetMailExtensions mimeType,
                  String filename)
           throws IOException
HTTP レスポンスに対してバイトを書き出すためのインスタンスを構築します。

このコンストラクタでは、HTTP レスポンスヘッダの Content-Type および Content-Disposition の設定を自動的に行います。 その他のヘッダへの設定は httpResponse に対して 直接設定をしてください。
HTTP レスポンスヘッダの Content-Type には、MIME タイプとして 引数 mimeType の表す MIME タイプを設定します。
HTTP レスポンスヘッダの Content-Disposition は、以下のように定義します。
Content-Disposition: attachment; filename=ファイル名
“ファイル名”の部分には、引数 filename が設定されます。

パラメータ:
mimeType - MIME タイプ
filename - ファイル名
例外:
IOException - 入出力エラー
メソッドの詳細

write

public void write(byte b)
           throws IOException
バイトの出力。

指定のバイトを HTTP レスポンスの出力ストリームに書き出します。

パラメータ:
b - ストリームに書き出すバイト
例外:
IOException - 入出力エラー

write

public void write(byte[] src)
           throws IOException
バイトの出力。

指定のバイトを HTTP レスポンスの出力ストリームに書き出します。

パラメータ:
src - ストリームに書き出すバイト列
例外:
IOException - 入出力エラー

write

public void write(byte[] src,
                  int off,
                  int len)
           throws IOException
バイトの出力。

オフセット off から始まる指定のバイト配列から HTTP レスポンスの 出力ストリームに len バイトを書き込みます。

パラメータ:
src - ストリームに書き出すバイト列
例外:
IOException - 入出力エラー

intra-mart(R) 6.0.13

Copyright © 2000-2009 NTT DATA INTRAMART CO.,LTD.. All Rights Reserved.