/**************************************************************** * Licensed to the Apache Software Foundation (ASF) under one * * or more contributor license agreements. See the NOTICE file * * distributed with this work for additional information * * regarding copyright ownership. The ASF licenses this file * * to you under the Apache License, Version 2.0 (the * * "License"); you may not use this file except in compliance * * with the License. You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, * * software distributed under the License is distributed on an * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * * KIND, either express or implied. See the License for the * * specific language governing permissions and limitations * * under the License. * ****************************************************************/ package org.apache.james.mime4j.dom.field; import java.util.Date; import java.util.Map; public interface ContentDispositionField extends ParsedField { /** The inline disposition type. */ public static final String DISPOSITION_TYPE_INLINE = "inline"; /** The attachment disposition type. */ public static final String DISPOSITION_TYPE_ATTACHMENT = "attachment"; /** The name of the filename parameter. */ public static final String PARAM_FILENAME = "filename"; /** The name of the creation-date parameter. */ public static final String PARAM_CREATION_DATE = "creation-date"; /** The name of the modification-date parameter. */ public static final String PARAM_MODIFICATION_DATE = "modification-date"; /** The name of the read-date parameter. */ public static final String PARAM_READ_DATE = "read-date"; /** The name of the size parameter. */ public static final String PARAM_SIZE = "size"; /** * Gets the disposition type defined in this Content-Disposition field. * * @return the disposition type or an empty string if not set. */ String getDispositionType(); /** * Gets the value of a parameter. Parameter names are case-insensitive. * * @param name * the name of the parameter to get. * @return the parameter value or null if not set. */ String getParameter(String name); /** * Gets all parameters. * * @return the parameters. */ Map getParameters(); /** * Determines if the disposition type of this field matches the given one. * * @param dispositionType * the disposition type to match against. * @return true if the disposition type of this field * matches, false otherwise. */ boolean isDispositionType(String dispositionType); /** * Return true if the disposition type of this field is * inline, false otherwise. * * @return true if the disposition type of this field is * inline, false otherwise. */ boolean isInline(); /** * Return true if the disposition type of this field is * attachment, false otherwise. * * @return true if the disposition type of this field is * attachment, false otherwise. */ public abstract boolean isAttachment(); /** * Gets the value of the filename parameter if set. * * @return the filename parameter value or null * if not set. */ String getFilename(); /** * Gets the value of the creation-date parameter if set and * valid. * * @return the creation-date parameter value or * null if not set or invalid. */ Date getCreationDate(); /** * Gets the value of the modification-date parameter if set * and valid. * * @return the modification-date parameter value or * null if not set or invalid. */ Date getModificationDate(); /** * Gets the value of the read-date parameter if set and * valid. * * @return the read-date parameter value or null * if not set or invalid. */ Date getReadDate(); /** * Gets the value of the size parameter if set and valid. * * @return the size parameter value or -1 if * not set or invalid. */ long getSize(); }