From f451a09f224e2694c76cb786e2064b62462b03a5 Mon Sep 17 00:00:00 2001 From: Michael Zhou Date: Wed, 7 Nov 2012 21:37:09 -0600 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3DiskFileItem.finalize?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=B0=83=E7=94=A8super.finalize=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E9=80=A0=E6=88=90=E7=9A=84=E5=B0=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B=20=E5=8D=87=E7=BA=A7pom.xml=E4=B8=AD=E7=9A=84jetty?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +++--- .../citrus/service/upload/impl/cfu/DiskFileItem.java | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 9b19880ac..d300ad76c 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 3.1.1.RELEASE 1.0 1.0 - 6.1.22 + 8.1.7.v20120910 ${java.encoding} true @@ -670,7 +670,7 @@ org.mortbay.jetty - maven-jetty-plugin + jetty-maven-plugin citrus 9999 @@ -743,7 +743,7 @@ org.mortbay.jetty - maven-jetty-plugin + jetty-maven-plugin ${jetty-version} diff --git a/service/upload/src/main/java/com/alibaba/citrus/service/upload/impl/cfu/DiskFileItem.java b/service/upload/src/main/java/com/alibaba/citrus/service/upload/impl/cfu/DiskFileItem.java index 3cacafbd9..e1c92bcc7 100644 --- a/service/upload/src/main/java/com/alibaba/citrus/service/upload/impl/cfu/DiskFileItem.java +++ b/service/upload/src/main/java/com/alibaba/citrus/service/upload/impl/cfu/DiskFileItem.java @@ -29,11 +29,15 @@ public DiskFileItem(String fieldName, String contentType, boolean isFormField, S /** Removes the file contents from the temporary storage. */ @Override - protected void finalize() { - File outputFile = dfos.getFile(); + protected void finalize() throws Throwable { + try { + File outputFile = dfos.getFile(); - if (outputFile != null && outputFile.exists()) { - outputFile.delete(); + if (outputFile != null && outputFile.exists()) { + outputFile.delete(); + } + } finally { + super.finalize(); } } }