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  import org.apache.commons.fileupload.disk.DiskFileItem;
21  
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   * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
37   * @author <a href="mailto:sean@informage.net">Sean Legassick</a>
38   * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
39   * @author <a href="mailto:jmcnally@apache.org">John McNally</a>
40   * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
41   * @author Sean C. Sullivan
42   *
43   * @version $Id: DefaultFileItem.java 479262 2006-11-26 03:09:24Z niallp $
44   *
45   * @deprecated Use <code>DiskFileItem</code> instead.
46   */
47  public class DefaultFileItem
48      extends DiskFileItem {
49  
50      // ----------------------------------------------------------- Constructors
51  
52  
53      /**
54       * Constructs a new <code>DefaultFileItem</code> instance.
55       *
56       * @param fieldName     The name of the form field.
57       * @param contentType   The content type passed by the browser or
58       *                      <code>null</code> if not specified.
59       * @param isFormField   Whether or not this item is a plain form field, as
60       *                      opposed to a file upload.
61       * @param fileName      The original filename in the user's filesystem, or
62       *                      <code>null</code> if not specified.
63       * @param sizeThreshold The threshold, in bytes, below which items will be
64       *                      retained in memory and above which they will be
65       *                      stored as a file.
66       * @param repository    The data repository, which is the directory in
67       *                      which files will be created, should the item size
68       *                      exceed the threshold.
69       *
70       * @deprecated Use <code>DiskFileItem</code> instead.
71       */
72      public DefaultFileItem(String fieldName, String contentType,
73              boolean isFormField, String fileName, int sizeThreshold,
74              File repository) {
75          super(fieldName, contentType, isFormField, fileName, sizeThreshold,
76                  repository);
77      }
78  
79  
80  }