www.dextsolution.com
DEXTUPLOAD
JK
menu toggleリファレンス > dextuploadjk > engine > FileDownloadOption

dextuploadjk.engine
Class FileDownloadOption

最小サポートバージョン
1.0.0
最小サポート環境
Java 17, Jakarta EE 9+
説明

ファイルをダウンロードするときに必要なオプションを設定するクラスです。 FileDownloadクラスのダウンロードメソッドで使用されます。

// Use FileDownloadOption
FileDownloadOption option = new FileDownloadOption();
option.setFilename("sea.png");
option.setMime("image/png");
downloader.download(request, response, target, option);
コンストラクタ

FileDownloadOption

  • FileDownloadOptionクラスのオブジェクトを作成します。
  • 形式

    public FileDownloadOption()
    public FileDownloadOption(String filename, String mime, FileResponseContentDisposition contentDisposition, boolean useClientCache)
  • パラメータ

    名前 形式 説明
    filename java.lang.String ファイルのダウンロード名
    mime java.lang.String ファイルのMIMEタイプ
    contentDisposition dextuploadjk.engine.FileResponseContentDisposition ファイルコンテンツがブラウザに配信される方法
    useClientCache boolean キャッシュポリシーを使用するかどうか
メソッド

getFilename

  • ファイルのダウンロード名を返す
  • 形式

    public String getFilename()
  • リターン

    ファイル名

setFilename

  • ファイルのダウンロード名を設定します。

  • 形式

    public void setFilename(String filename)
  • パラメータ

    名前 形式 説明
    filename java.lang.String ファイル名
  • 使い方

    FileDownloadOption option = new FileDownloadOption();
    option.setFilename("sea.png");

getMime

  • ファイルのMIME-TYPEを返します。
  • 形式

    public String getMime()
  • リターン

    ファイルのMIME-TYPE、デフォルトはapplication / octet-streamです。

setMime

  • ファイルのMIME-TYPEを設定します。

  • 形式

    public void setMime(String mime)
  • パラメータ

    名前 形式 説明
    mime java.lang.String ファイルのMIME-TYPE
  • 使い方

    FileDownloadOption option = new FileDownloadOption();
    option.setMime("image/png");

getContentDisposition

  • ファイルコンテンツがブラウザに配信される方法を返します。

  • 形式

    public FileResponseContentDisposition getContentDisposition()
  • リターン

    FileResponseContentDispositionオブジェクト、デフォルトはFileResponseContentDisposition.AttachmentWithNameです。

setContentDisposition

  • ブラウザでファイルの内容を処理する方法を設定します。

  • 形式

    public void setContentDisposition(FileResponseContentDisposition contentDisposition)
  • パラメータ

    名前 形式 説明
    contentDisposition dextuploadjk.engine.FileResponseContentDisposition ブロワーでファイルコンテンツを処理する方法
  • 使い方

    FileDownloadOption option = new FileDownloadOption();
    option.setContentDisposition(FileResponseContentDisposition.Inline);

isUseClientCache

  • キャッシュポリシーを使用するかどうかを返します。

  • 形式

    public boolean isUseClientCache()
  • リターン

    true(デフォルト)またはfalse

setUseClientCache

  • キャッシュポリシーを使用するかどうかを設定します。

    setUseClientCacheを使用するかどうかに関係なく、キャッシュポリシーはメモリデータのダウンロードに使用できません。

  • 形式

    public void setUseClientCache(boolean useClientCache)
  • パラメータ

    名前 形式 説明
    useClientCache boolean trueまたはfalse
  • 使い方

    FileDownloadOption option = new FileDownloadOption();
    option.setUseClientCache(false);