Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 13793 invoked from network); 1 Jun 2003 17:33:31 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 1 Jun 2003 17:33:31 -0000 Received: (qmail 27642 invoked by uid 97); 1 Jun 2003 17:35:46 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 27635 invoked from network); 1 Jun 2003 17:35:46 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 1 Jun 2003 17:35:46 -0000 Received: (qmail 13199 invoked by uid 500); 1 Jun 2003 17:33:26 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 13173 invoked by uid 500); 1 Jun 2003 17:33:25 -0000 Received: (qmail 13082 invoked from network); 1 Jun 2003 17:33:25 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 1 Jun 2003 17:33:25 -0000 Received: (qmail 60629 invoked by uid 1339); 1 Jun 2003 17:33:24 -0000 Date: 1 Jun 2003 17:33:24 -0000 Message-ID: <20030601173324.60628.qmail@icarus.apache.org> From: martinc@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/fileupload/src/java/org/apache/commons/fileupload DefaultFileItem.java FileItem.java FileUpload.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 write(File) 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 FileItem instance is garbage @@ -556,24 +537,6 @@ public void setFormField(boolean state) { isFormField = state; - } - - - /** - * Specifies whether or not a FileItem instance represents - * a simple form field. - * - * @param state true if the instance represents a simple form - * field; false if it represents an uploaded file. - * - * @see #isFormField() - * - * @deprecated Use setFormField() 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. - *

- * 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 write(File) 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 FileItem instance is garbage @@ -280,18 +259,6 @@ * field; false if it represents an uploaded file. */ void setFormField(boolean state); - - - /** - * Specifies whether or not a FileItem instance represents - * a simple form field. - * - * @param state true if the instance represents a simple form - * field; false if it represents an uploaded file. - * - * @deprecated Use setFormField() 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 DiskFileUpload 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 DiskFileUpload 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 DiskFileUpload 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 DiskFileUpload class. - * - */ - public void setRepositoryPath(String repositoryPath) - { - if (fileItemFactory instanceof DefaultFileItemFactory) - { - DefaultFileItemFactory factory = - (DefaultFileItemFactory) fileItemFactory; - factory.setRepository(new File(repositoryPath)); - } - } - - - // --------------------------------------------------------- Public methods - - /** - * Processes an RFC 1867 - * compliant multipart/form-data stream. If files are stored - * on disk, the path is given by getRepository(). - * - * @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 FileItem 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 DiskFileUpload 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