在Java中,`ContentDisposition`类通常指的是用于表示HTTP响应中`Content-Disposition`头的类

在Java中,ContentDisposition类通常指的是用于表示HTTP响应中Content-Disposition头的类。这个类并不是Java标准库的一部分,而是可能存在于某些第三方库或框架中,用于处理和解析Content-Disposition头。

Content-Disposition头用于指示MIME消息(如HTTP响应)中实体内容的意图。它通常用于指定下载文件时的文件名,或者指示内容是否应该直接在浏览器中显示。Content-Disposition头可以包含一个filename参数,用于建议下载文件的名称。

如果ContentDisposition类存在于某个特定的库中,那么该类可能会提供以下功能:

  1. 构造函数:允许你根据Content-Disposition头的值创建一个ContentDisposition对象。
  2. 获取和设置参数:提供方法来获取和设置Content-Disposition头中的各种参数,如filename
  3. 解析Content-Disposition:提供方法来分析Content-Disposition头的字符串表示形式,并提取相关参数。
  4. 生成Content-Disposition头的字符串表示:提供方法将ContentDisposition对象转换为其对应的HTTP头字符串。

请注意,由于ContentDisposition类不是Java标准库的一部分,你需要查找包含此类定义的特定库或框架。在实际应用中,你可能需要查看你所使用的HTTP客户端或服务器库是否提供了这样的类或接口来处理Content-Disposition头。
Skip navigation links

Overview
Package
Class
Use
Tree
Deprecated
Index
Help

Prev Class
Next Class

Frames
No Frames

Summary: 
Nested | 
Field | 
Constr | 
Method

Detail: 
Field | 
Constr | 
Method

javax.mail.internet
Class ContentDisposition

java.lang.Object
    javax.mail.internet.ContentDisposition 


public class ContentDisposition
extends Object

This class represents a MIME ContentDisposition value. It provides methods to parse a ContentDisposition string into individual components and to generate a MIME style ContentDisposition string.

Author:
    John Mani

    Constructor Summary
    Constructors Constructor and Description
    ContentDisposition()
    No-arg Constructor.
    ContentDisposition(String s)
    Constructor that takes a ContentDisposition string.
    ContentDisposition(String disposition, ParameterList list)
    Constructor.
    Method Summary
    All MethodsInstance MethodsConcrete Methods Modifier and Type 	Method and Description
    String 	getDisposition()
    Return the disposition value.
    String 	getParameter(String name)
    Return the specified parameter value.
    ParameterList 	getParameterList()
    Return a ParameterList object that holds all the available parameters.
    void 	setDisposition(String disposition)
    Set the disposition.
    void 	setParameter(String name, String value)
    Set the specified parameter.
    void 	setParameterList(ParameterList list)
    Set a new ParameterList.
    String 	toString()
    Retrieve a RFC2045 style string representation of this ContentDisposition.
        Methods inherited from class java.lang.Object
        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Constructor Detail
        ContentDisposition

        public ContentDisposition()

        No-arg Constructor.
        ContentDisposition

        public ContentDisposition(String disposition,
                                  ParameterList list)

        Constructor.

        Parameters:
            disposition - disposition
            list - ParameterList
        Since:
            JavaMail 1.2

        ContentDisposition

        public ContentDisposition(String s)
                           throws ParseException

        Constructor that takes a ContentDisposition string. The String is parsed into its constituents: dispostion and parameters. A ParseException is thrown if the parse fails.

        Parameters:
            s - the ContentDisposition string.
        Throws:
            ParseException - if the parse fails.
        Since:
            JavaMail 1.2

    Method Detail
        getDisposition

        public String getDisposition()

        Return the disposition value.

        Returns:
            the disposition
        Since:
            JavaMail 1.2

        getParameter

        public String getParameter(String name)

        Return the specified parameter value. Returns null if this parameter is absent.

        Parameters:
            name - the parameter name
        Returns:
            parameter value
        Since:
            JavaMail 1.2

        getParameterList

        public ParameterList getParameterList()

        Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.

        Returns:
            ParameterList
        Since:
            JavaMail 1.2

        setDisposition

        public void setDisposition(String disposition)

        Set the disposition. Replaces the existing disposition.

        Parameters:
            disposition - the disposition
        Since:
            JavaMail 1.2

        setParameter

        public void setParameter(String name,
                                 String value)

        Set the specified parameter. If this parameter already exists, it is replaced by this new value.

        Parameters:
            name - parameter name
            value - parameter value
        Since:
            JavaMail 1.2

        setParameterList

        public void setParameterList(ParameterList list)

        Set a new ParameterList.

        Parameters:
            list - ParameterList
        Since:
            JavaMail 1.2

        toString

        public String toString()

        Retrieve a RFC2045 style string representation of this ContentDisposition. Returns an empty string if the conversion failed.

        Overrides:
            toString in class Object
        Returns:
            RFC2045 style string
        Since:
            JavaMail 1.2

Skip navigation links

Overview
Package
Class
Use
Tree
Deprecated
Index
Help

Prev Class
Next Class

Frames
No Frames

Summary: 
Nested | 
Field | 
Constr | 
Method

Detail: 
Field | 
Constr | 
Method

Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值