Author: markt
Date: Mon Apr 22 10:35:10 2013
New Revision: 1470437
URL: http://svn.apache.org/r1470437
Log:
Clean-up: Remove unnecessary code.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/ (props
changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1470435
Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/
------------------------------------------------------------------------------
Merged /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload:r1470435
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1470437&r1=1470436&r2=1470437&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
Mon Apr 22 10:35:10 2013
@@ -20,7 +20,6 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.Serializable;
import java.io.UnsupportedEncodingException;
/**
@@ -46,7 +45,7 @@ import java.io.UnsupportedEncodingExcept
* @version $Id$
* @since 1.3 additionally implements FileItemHeadersSupport
*/
-public interface FileItem extends Serializable, FileItemHeadersSupport {
+public interface FileItem extends FileItemHeadersSupport {
// ------------------------------- Methods from javax.activation.DataSource
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java?rev=1470437&r1=1470436&r2=1470437&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
Mon Apr 22 10:35:10 2013
@@ -24,8 +24,6 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Map;
@@ -78,11 +76,6 @@ public class DiskFileItem
// ----------------------------------------------------- Manifest constants
/**
- * The UID to use when serializing this instance.
- */
- private static final long serialVersionUID = 2237570099615271025L;
-
- /**
* Default content charset to be used when no explicit charset
* parameter is provided by the sender. Media subtypes of the
* "text" type are defined to have a default charset value of
@@ -157,11 +150,6 @@ public class DiskFileItem
private transient File tempFile;
/**
- * File to allow for serialization of the content of this item.
- */
- private File dfosFile;
-
- /**
* The file items headers.
*/
private FileItemHeaders headers;
@@ -638,55 +626,6 @@ public class DiskFileItem
Boolean.valueOf(isFormField()), getFieldName());
}
- // -------------------------------------------------- Serialization methods
-
- /**
- * Writes the state of this object during serialization.
- *
- * @param out The stream to which the state should be written.
- *
- * @throws IOException if an error occurs.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Read the data
- if (dfos.isInMemory()) {
- cachedContent = get();
- } else {
- cachedContent = null;
- dfosFile = dfos.getFile();
- }
-
- // write out values
- out.defaultWriteObject();
- }
-
- /**
- * Reads the state of this object during deserialization.
- *
- * @param in The stream from which the state should be read.
- *
- * @throws IOException if an error occurs.
- * @throws ClassNotFoundException if class cannot be found.
- */
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- // read values
- in.defaultReadObject();
-
- OutputStream output = getOutputStream();
- if (cachedContent != null) {
- output.write(cachedContent);
- } else {
- FileInputStream input = new FileInputStream(dfosFile);
- IOUtils.copy(input, output);
- dfosFile.delete();
- dfosFile = null;
- }
- output.close();
-
- cachedContent = null;
- }
-
/**
* Returns the file item headers.
* @return The file items headers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]