]> WPIA git - gigi.git/blob - lib/servlet-api/javax/servlet/annotation/MultipartConfig.java
Merge "upd: remove 'browser install'"
[gigi.git] / lib / servlet-api / javax / servlet / annotation / MultipartConfig.java
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package javax.servlet.annotation;
18
19 import java.lang.annotation.ElementType;
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22 import java.lang.annotation.Target;
23
24 /**
25  * This annotation is used to indicate that the {@link javax.servlet.Servlet} on
26  * which it is declared expects requests to made using the {@code
27  * multipart/form-data} MIME type. <br />
28  * <br />
29  *
30  * {@link javax.servlet.http.Part} components of a given {@code
31  * multipart/form-data} request are retrieved by a Servlet annotated with
32  * {@code MultipartConfig} by calling
33  * {@link javax.servlet.http.HttpServletRequest#getPart} or
34  * {@link javax.servlet.http.HttpServletRequest#getParts}.<br />
35  * <br />
36  *
37  * E.g. <code>@WebServlet("/upload")}</code><br />
38  *
39  * <code>@MultipartConfig()</code> <code>public class UploadServlet extends
40  * HttpServlet ... } </code><br />
41  *
42  * @since Servlet 3.0
43  */
44 @Target({ElementType.TYPE})
45 @Retention(RetentionPolicy.RUNTIME)
46 public @interface MultipartConfig {
47
48     /**
49      * @return location in which the Container stores temporary files
50      */
51     String location() default "";
52
53     /**
54      * @return the maximum size allowed for uploaded files (in bytes)
55      */
56     long maxFileSize() default -1L;
57
58     /**
59      * @return the maximum size of the request allowed for {@code
60      *         multipart/form-data}
61      */
62     long maxRequestSize() default -1L;
63
64     /**
65      * @return the size threshold at which the file will be written to the disk
66      */
67     int fileSizeThreshold() default 0;
68 }