⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contentdisposition.java

📁 封装了SQL、Socket、WAP、MIME等功能的通用组件
💻 JAVA
字号:
package org.lazybug.mime;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ContentDisposition
{
    public static final String CONTENT_DISPOSITION_INLINE = "INLINE";
    public static final String CONTENT_DISPOSITION_ATTACHMENT = "ATTACHMENT";

    private String type;
    private ParameterList list;

    public ContentDisposition(String s) throws ParseException
    {
        HeaderTokenizer headertokenizer = new HeaderTokenizer(s, "()<>@,;:\\\"\t []?=");
        HeaderTokenizer.Token token = headertokenizer.next();
        if(token.getType() != -1)
            throw new ParseException();
        type = token.getValue();
        String s1 = headertokenizer.getRemainder();
        if(s1 != null) list = new ParameterList(s1);
    }

    public ContentDisposition()
    {
    }

    public String getBaseType()
    {
        return type;
    }

    public String getParameter(String s)
    {
        if(list == null)
            return null;
        else
            return list.get(s);
    }

    public void setParameter(String token, String value)
    {
        if(list == null) list = new ParameterList();
        list.set(token, value);
    }

    public String toString()
    {
        if( type == null )
            return "";
        StringBuffer stringbuffer = new StringBuffer();
        stringbuffer.append(type);
        if(list != null)
            stringbuffer.append(list.toString(stringbuffer.length() + 14));
        return stringbuffer.toString();
    }

    public static void main(String[] args)
    {
        ContentDisposition contentdisposition = new ContentDisposition();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -