[jboss-cvs] JBossAS SVN: r86100 - branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 19 08:33:34 EDT 2009


Author: emuckenhuber
Date: 2009-03-19 08:33:34 -0400 (Thu, 19 Mar 2009)
New Revision: 86100

Modified:
   branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java
Log:
close streams.

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java	2009-03-19 10:29:34 UTC (rev 86099)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java	2009-03-19 12:33:34 UTC (rev 86100)
@@ -78,7 +78,14 @@
       unmarshaller.setValidation(false);
       unmarshaller.setSchemaValidation(false);
       InputStream is = new FileInputStream(attachmentsStore);
-      return (T) unmarshaller.unmarshal(is, resolver);
+      try
+      {
+         return (T) unmarshaller.unmarshal(is, resolver);
+      }
+      finally
+      {
+         is.close();
+      }
    }
 
    protected void saveAttachment(File attachmentsStore, Object attachment) throws Exception
@@ -89,7 +96,14 @@
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
       OutputStream os = new FileOutputStream(attachmentsStore);
-      marshaller.marshal(attachment, os);
+      try
+      {
+         marshaller.marshal(attachment, os);
+      }
+      finally
+      {
+         os.close();
+      }
    }
    
    @Override




More information about the jboss-cvs-commits mailing list