View Javadoc
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 org.apache.commons.fileupload;
18  
19  import java.io.File;
20  
21  import org.apache.commons.fileupload.disk.DiskFileItem;
22  
23  /**
24   * <p> The default implementation of the
25   * {@link org.apache.commons.fileupload.FileItem FileItem} interface.
26   *
27   * <p> After retrieving an instance of this class from a {@link
28   * org.apache.commons.fileupload.DiskFileUpload DiskFileUpload} instance (see
29   * {@link org.apache.commons.fileupload.DiskFileUpload
30   * #parseRequest(javax.servlet.http.HttpServletRequest)}), you may
31   * either request all contents of file at once using {@link #get()} or
32   * request an {@link java.io.InputStream InputStream} with
33   * {@link #getInputStream()} and process the file without attempting to load
34   * it into memory, which may come handy with large files.
35   *
36   * @deprecated 1.1 Use {@code DiskFileItem} instead.
37   */
38  @Deprecated
39  public class DefaultFileItem
40      extends DiskFileItem {
41  
42      /**
43       * Constructs a new {@code DefaultFileItem} instance.
44       *
45       * @param fieldName     The name of the form field.
46       * @param contentType   The content type passed by the browser or
47       *                      {@code null} if not specified.
48       * @param isFormField   Whether or not this item is a plain form field, as
49       *                      opposed to a file upload.
50       * @param fileName      The original file name in the user's file system, or
51       *                      {@code null} if not specified.
52       * @param sizeThreshold The threshold, in bytes, below which items will be
53       *                      retained in memory and above which they will be
54       *                      stored as a file.
55       * @param repository    The data repository, which is the directory in
56       *                      which files will be created, should the item size
57       *                      exceed the threshold.
58       *
59       * @deprecated 1.1 Use {@code DiskFileItem} instead.
60       */
61      @Deprecated
62      public DefaultFileItem(final String fieldName, final String contentType,
63              final boolean isFormField, final String fileName, final int sizeThreshold,
64              final File repository) {
65          super(fieldName, contentType, isFormField, fileName, sizeThreshold,
66                  repository);
67      }
68  
69  }