Remove unused code after removal of serialization support
diff --git a/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java b/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
index c5e4c8c..980e411 100644
--- a/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
@@ -43,11 +43,6 @@
// ----------------------------------------------------------- Constructors
/**
- * The UID to use when serializing this instance.
- */
- private static final long serialVersionUID = 4088572813833518255L;
-
- /**
* Constructs a new <code>DefaultFileItem</code> instance.
*
* @param fieldName The name of the form field.
diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
index 6f8782c..090ed28 100644
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
@@ -76,11 +76,6 @@
// ----------------------------------------------------- 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
@@ -155,11 +150,6 @@
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;
diff --git a/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java b/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
index c352f68..dccdd11 100644
--- a/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
+++ b/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
@@ -32,7 +32,6 @@
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -88,14 +87,14 @@
compareBytes("Initial", item.get(), testFieldValueBytes);
item.delete();
}
-
+
/**
* Helper method to test creation of a field.
*/
private void testInMemoryObject(byte[] testFieldValueBytes) {
testInMemoryObject(testFieldValueBytes, REPO);
}
-
+
/**
* Test creation of a field for which the amount of data falls below the
* configured threshold.
@@ -135,7 +134,7 @@
item.delete();
}
-
+
/**
* Test serialization and deserialization when repository is not null.
*/
@@ -145,7 +144,7 @@
byte[] testFieldValueBytes = createContentBytes(threshold);
testInMemoryObject(testFieldValueBytes, REPO);
}
-
+
/**
* Test deserialization fails when repository is not valid.
*/
@@ -157,7 +156,7 @@
FileItem item = createFileItem(testFieldValueBytes, repository);
deserialize(serialize(item));
}
-
+
/**
* Test deserialization fails when repository contains a null character.
*/
@@ -171,17 +170,6 @@
}
/**
- * Compare FileItem's (except the byte[] content)
- */
- private void compareFileItems(FileItem origItem, FileItem newItem) {
- assertTrue("Compare: is in Memory", origItem.isInMemory() == newItem.isInMemory());
- assertTrue("Compare: is Form Field", origItem.isFormField() == newItem.isFormField());
- assertEquals("Compare: Field Name", origItem.getFieldName(), newItem.getFieldName());
- assertEquals("Compare: Content Type", origItem.getContentType(), newItem.getContentType());
- assertEquals("Compare: File Name", origItem.getName(), newItem.getName());
- }
-
- /**
* Compare content bytes.
*/
private void compareBytes(String text, byte[] origBytes, byte[] newBytes) {
@@ -233,14 +221,14 @@
return item;
}
-
+
/**
* Create a FileItem with the specfied content bytes.
*/
private FileItem createFileItem(byte[] contentBytes) {
return createFileItem(contentBytes, REPO);
}
-
+
/**
* Do serialization
*/
@@ -252,7 +240,7 @@
oos.close();
return baos;
}
-
+
/**
* Do deserialization
*/
@@ -266,28 +254,4 @@
return result;
}
-
- /**
- * Do serialization and deserialization.
- */
- private Object serializeDeserialize(Object target) {
- // Serialize the test object
- ByteArrayOutputStream baos = null;
- try {
- baos = serialize(target);
- } catch (Exception e) {
- fail("Exception during serialization: " + e);
- }
-
- // Deserialize the test object
- Object result = null;
- try {
- result = deserialize(baos);
- } catch (Exception e) {
- fail("Exception during deserialization: " + e);
- }
- IOUtils.closeQuietly(baos);
- return result;
- }
-
}