1 /****************************************************************
2 * Licensed to the Apache Software Foundation (ASF) under one *
3 * or more contributor license agreements. See the NOTICE file *
4 * distributed with this work for additional information *
5 * regarding copyright ownership. The ASF licenses this file *
6 * to you under the Apache License, Version 2.0 (the *
7 * "License"); you may not use this file except in compliance *
8 * with the License. You may obtain a copy of the License at *
10 * http://www.apache.org/licenses/LICENSE-2.0 *
12 * Unless required by applicable law or agreed to in writing, *
13 * software distributed under the License is distributed on an *
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15 * KIND, either express or implied. See the License for the *
16 * specific language governing permissions and limitations *
17 * under the License. *
18 ****************************************************************/
20 package org
.apache
.james
.mime4j
;
25 * Represents common content properties.
30 public interface ContentDescriptor
{
32 * Returns the body descriptors MIME type.
33 * @see #getMediaType()
35 * @return The MIME type, which has been parsed from the
36 * content-type definition. Must not be null, but
37 * "text/plain", if no content-type was specified.
42 * Gets the defaulted MIME media type for this content.
43 * For example <code>TEXT</code>, <code>IMAGE</code>, <code>MULTIPART</code>
45 * @return the MIME media type when content-type specified,
46 * otherwise the correct default (<code>TEXT</code>)
48 String
getMediaType();
51 * Gets the defaulted MIME sub type for this content.
53 * @return the MIME media type when content-type is specified,
54 * otherwise the correct default (<code>PLAIN</code>)
59 * <p>The body descriptors character set, defaulted appropriately for the MIME type.</p>
61 * For <code>TEXT</code> types, this will be defaulted to <code>us-ascii</code>.
62 * For other types, when the charset parameter is missing this property will be null.
64 * @return Character set, which has been parsed from the
65 * content-type definition. Not null for <code>TEXT</code> types, when unset will
66 * be set to default <code>us-ascii</code>. For other types, when unset,
67 * null will be returnedsvn s
72 * Returns the body descriptors transfer encoding.
73 * @return The transfer encoding. Must not be null, but "7bit",
74 * if no transfer-encoding was specified.
76 String
getTransferEncoding();
79 * Returns the map of parameters of the content-type header.
81 Map
getContentTypeParameters();
84 * Returns the body descriptors content-length.
85 * @return Content length, if known, or -1, to indicate the absence of a
86 * content-length header.
88 long getContentLength();