This change breaks backwards compatibility but I think is justified. I agree that...
[mime4j.git] / src / main / java / org / apache / james / mime4j / ContentDescriptor.java
blob51b8b9b0b2ddeed1949b1534c7fd6565b422a1a3
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 *
9 * *
10 * http://www.apache.org/licenses/LICENSE-2.0 *
11 * *
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;
22 import java.util.Map;
24 /**
25 * Represents common content properties.
28 * @version $Id:$
30 public interface ContentDescriptor {
31 /**
32 * Returns the body descriptors MIME type.
33 * @see #getMediaType()
34 * @see #getSubType()
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.
39 String getMimeType();
41 /**
42 * Gets the defaulted MIME media type for this content.
43 * For example <code>TEXT</code>, <code>IMAGE</code>, <code>MULTIPART</code>
44 * @see #getMimeType()
45 * @return the MIME media type when content-type specified,
46 * otherwise the correct default (<code>TEXT</code>)
48 String getMediaType();
50 /**
51 * Gets the defaulted MIME sub type for this content.
52 * @see #getMimeType()
53 * @return the MIME media type when content-type is specified,
54 * otherwise the correct default (<code>PLAIN</code>)
56 String getSubType();
58 /**
59 * <p>The body descriptors character set, defaulted appropriately for the MIME type.</p>
60 * <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.
63 * </p>
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
69 String getCharset();
71 /**
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();
78 /**
79 * Returns the map of parameters of the content-type header.
81 Map getContentTypeParameters();
83 /**
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();