You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/02/11 18:54:36 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/upload TurbineUploadService.java UploadService.java
quintonm 2003/02/11 09:54:36
Modified: src/java/org/apache/turbine/services/upload
TurbineUploadService.java UploadService.java
Log:
Switched to commons-fileupload
Revision Changes Path
1.5 +9 -8 jakarta-turbine-2/src/java/org/apache/turbine/services/upload/TurbineUploadService.java
Index: TurbineUploadService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/upload/TurbineUploadService.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TurbineUploadService.java 11 Jul 2002 16:53:23 -0000 1.4
+++ TurbineUploadService.java 11 Feb 2003 17:54:36 -0000 1.5
@@ -62,8 +62,9 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.turbine.util.ParameterParser;
import org.apache.turbine.util.TurbineException;
-import org.apache.turbine.util.upload.FileItem;
-import org.apache.turbine.util.upload.MultipartStream;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.MultipartStream;
+import org.apache.commons.fileupload.DefaultFileItem;
/**
* <p> This class is an implementation of {@link UploadService}.
@@ -126,7 +127,7 @@
{
byte[] boundary = contentType.substring(
contentType.indexOf("boundary=")+9).getBytes();
- InputStream input = (InputStream)req.getInputStream();
+ InputStream input = req.getInputStream();
MultipartStream multi = new MultipartStream(input, boundary);
boolean nextPart = multi.skipPreamble();
@@ -288,10 +289,10 @@
Map headers,
int requestSize )
{
- return FileItem.newInstance(path,
- getFileName(headers),
- getHeader(headers, CONTENT_TYPE),
- requestSize);
+
+ return DefaultFileItem.newInstance(path, getFileName(headers),
+ getHeader(headers, CONTENT_TYPE), requestSize,
+ getSizeThreshold());
}
/**
1.3 +6 -6 jakarta-turbine-2/src/java/org/apache/turbine/services/upload/UploadService.java
Index: UploadService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/upload/UploadService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UploadService.java 11 Jan 2003 18:42:35 -0000 1.2
+++ UploadService.java 11 Feb 2003 17:54:36 -0000 1.3
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -190,7 +190,7 @@
* @param params The ParameterParser instance to insert form
* fields into.
* @param path The location where the files should be stored.
- * @exception IOException, if there are problems reading/parsing
+ * @exception TurbineException if there are problems reading/parsing
* the request or storing files.
*/
void parseRequest( HttpServletRequest req,
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org