commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@apache.org
Subject cvs commit: jakarta-commons/fileupload/src/java/org/apache/commons/fileupload DefaultFileItem.java FileItem.java FileUpload.java
Date Sun, 01 Jun 2003 17:33:24 GMT
martinc     2003/06/01 10:33:24

  Modified:    fileupload/src/java/org/apache/commons/fileupload
                        DefaultFileItem.java FileItem.java FileUpload.java
  Log:
  Remove deprecated methods in preparation for a release candidate.
  
  Revision  Changes    Path
  1.20      +4 -41     jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItem.java
  
  Index: DefaultFileItem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItem.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultFileItem.java	31 May 2003 22:31:08 -0000	1.19
  +++ DefaultFileItem.java	1 Jun 2003 17:33:24 -0000	1.20
  @@ -462,25 +462,6 @@
   
   
       /**
  -     * A convenience method to write an uploaded item to disk. The client code
  -     * is not concerned with whether or not the item is stored in memory, or on
  -     * disk in a temporary location. They just want to write the uploaded item
  -     * to a file.
  -     *
  -     * @param file The full path to location where the uploaded file should
  -     *             be stored.
  -     *
  -     * @exception Exception if an error occurs.
  -     *
  -     * @deprecated Use <code>write(File)</code> instead.
  -     */
  -    public void write(String file) throws Exception
  -    {
  -        write(new File(file));
  -    }
  -
  -
  -    /**
        * Deletes the underlying storage for a file item, including deleting any
        * associated temporary disk file. Although this storage will be deleted
        * automatically when the <code>FileItem</code> instance is garbage
  @@ -556,24 +537,6 @@
       public void setFormField(boolean state)
       {
           isFormField = state;
  -    }
  -
  -
  -    /**
  -     * Specifies whether or not a <code>FileItem</code> instance represents
  -     * a simple form field.
  -     *
  -     * @param state <code>true</code> if the instance represents a simple form
  -     *              field; <code>false</code> if it represents an uploaded
file.
  -     *
  -     * @see #isFormField()
  -     *
  -     * @deprecated Use <code>setFormField()</code> instead.
  -     *
  -     */
  -    public void setIsFormField(boolean state)
  -    {
  -        setFormField(state);
       }
   
   
  
  
  
  1.15      +4 -37     jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileItem.java
  
  Index: FileItem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileItem.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FileItem.java	12 May 2003 05:24:52 -0000	1.14
  +++ FileItem.java	1 Jun 2003 17:33:24 -0000	1.15
  @@ -215,27 +215,6 @@
   
   
       /**
  -     * A convenience method to write an uploaded item to disk. The client code
  -     * is not concerned with whether or not the item is stored in memory, or on
  -     * disk in a temporary location. They just want to write the uploaded item
  -     * to a file.
  -     * <p>
  -     * This method is not guaranteed to succeed if called more than once for
  -     * the same item. This allows a particular implementation to use, for
  -     * example, file renaming, where possible, rather than copying all of the
  -     * underlying data, thus gaining a significant performance benefit.
  -     *
  -     * @param file The full path to location where the uploaded item should
  -     *             be stored.
  -     *
  -     * @exception Exception if an error occurs.
  -     *
  -     * @deprecated Use <code>write(File)</code> instead.
  -     */
  -    void write(String file) throws Exception;
  -
  -
  -    /**
        * Deletes the underlying storage for a file item, including deleting any
        * associated temporary disk file. Although this storage will be deleted
        * automatically when the <code>FileItem</code> instance is garbage
  @@ -280,18 +259,6 @@
        *              field; <code>false</code> if it represents an uploaded
file.
        */
       void setFormField(boolean state);
  -
  -
  -    /**
  -     * Specifies whether or not a <code>FileItem</code> instance represents
  -     * a simple form field.
  -     *
  -     * @param state <code>true</code> if the instance represents a simple form
  -     *              field; <code>false</code> if it represents an uploaded
file.
  -     *
  -     * @deprecated Use <code>setFormField()</code> instead.
  -     */
  -    void setIsFormField(boolean state);
   
   
       /**
  
  
  
  1.22      +4 -128    jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java
  
  Index: FileUpload.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- FileUpload.java	1 Jun 2003 00:18:13 -0000	1.21
  +++ FileUpload.java	1 Jun 2003 17:33:24 -0000	1.22
  @@ -157,128 +157,4 @@
       }
   
   
  -    /**
  -     * Returns the size threshold beyond which files are written directly to
  -     * disk.
  -     *
  -     * @return The size threshold, in bytes.
  -     *
  -     * @see #setSizeThreshold(int)
  -     *
  -     * @deprecated Functionality specific to a disk-based implementation has
  -     *             been moved to the <code>DiskFileUpload</code> class.
  -     */
  -    public int getSizeThreshold()
  -    {
  -        if (fileItemFactory instanceof DefaultFileItemFactory)
  -        {
  -            DefaultFileItemFactory factory =
  -                    (DefaultFileItemFactory) fileItemFactory;
  -            return factory.getSizeThreshold();
  -        }
  -        return -1;
  -    }
  -
  -
  -    /**
  -     * Sets the size threshold beyond which files are written directly to disk.
  -     *
  -     * @param sizeThreshold The size threshold, in bytes.
  -     *
  -     * @see #getSizeThreshold()
  -     *
  -     * @deprecated Functionality specific to a disk-based implementation has
  -     *             been moved to the <code>DiskFileUpload</code> class.
  -     *
  -     */
  -    public void setSizeThreshold(int sizeThreshold)
  -    {
  -        if (fileItemFactory instanceof DefaultFileItemFactory)
  -        {
  -            DefaultFileItemFactory factory =
  -                    (DefaultFileItemFactory) fileItemFactory;
  -            factory.setSizeThreshold(sizeThreshold);
  -        }
  -    }
  -
  -
  -    /**
  -     * Returns the location used to temporarily store files that are larger
  -     * than the configured size threshold.
  -     *
  -     * @return The path to the temporary file location.
  -     *
  -     * @see #setRepositoryPath(String)
  -     *
  -     * @deprecated Functionality specific to a disk-based implementation has
  -     *             been moved to the <code>DiskFileUpload</code> class.
  -     *
  -     */
  -    public String getRepositoryPath()
  -    {
  -        if (fileItemFactory instanceof DefaultFileItemFactory)
  -        {
  -            DefaultFileItemFactory factory =
  -                    (DefaultFileItemFactory) fileItemFactory;
  -            return factory.getRepository().getPath();
  -        }
  -        return null;
  -    }
  -
  -
  -    /**
  -     * Sets the location used to temporarily store files that are larger
  -     * than the configured size threshold.
  -     *
  -     * @param repositoryPath The path to the temporary file location.
  -     *
  -     * @see #getRepositoryPath()
  -     *
  -     * @deprecated Functionality specific to a disk-based implementation has
  -     *             been moved to the <code>DiskFileUpload</code> class.
  -     *
  -     */
  -    public void setRepositoryPath(String repositoryPath)
  -    {
  -        if (fileItemFactory instanceof DefaultFileItemFactory)
  -        {
  -            DefaultFileItemFactory factory =
  -                    (DefaultFileItemFactory) fileItemFactory;
  -            factory.setRepository(new File(repositoryPath));
  -        }
  -    }
  -
  -
  -    // --------------------------------------------------------- Public methods
  -
  -    /**
  -     * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
  -     * compliant <code>multipart/form-data</code> stream. If files are stored
  -     * on disk, the path is given by <code>getRepository()</code>.
  -     *
  -     * @param req           The servlet request to be parsed. Must be non-null.
  -     * @param sizeThreshold The max size in bytes to be stored in memory.
  -     * @param sizeMax       The maximum allowed upload size, in bytes.
  -     * @param path          The location where the files should be stored.
  -     *
  -     * @return A list of <code>FileItem</code> instances parsed from the
  -     *         request, in the order that they were transmitted.
  -     *
  -     * @exception FileUploadException if there are problems reading/parsing
  -     *                                the request or storing files.
  -     *
  -     * @deprecated Functionality specific to a disk-based implementation has
  -     *             been moved to the <code>DiskFileUpload</code> class.
  -     */
  -    public List /* FileItem */ parseRequest(HttpServletRequest req,
  -                                            int sizeThreshold,
  -                                            long sizeMax, String path)
  -        throws FileUploadException
  -    {
  -        setSizeThreshold(sizeThreshold);
  -        setSizeMax(sizeMax);
  -        setRepositoryPath(path);
  -        return parseRequest(req);
  -    }
  -
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message