Implement spring Conduit bean registry and lots of cleanup
[jpim.git] / src / de / j32 / pimstuff / conduit / FritzAddressbookExporter.java
index 0e86005..59c8a1d 100644 (file)
@@ -26,12 +26,15 @@ public class FritzAddressbookExporter
                        gen_.start("phonebooks"); gen_.nl();
                        gen_.start("phonebook"); gen_.nl();
                }
-               catch (SAXException e)
-               {
+               catch (SAXException e) {
                        throw new AssertionError("Invalid XML/SAX document generated.");
-               } catch (UnsupportedEncodingException e) {
+               }
+               catch (UnsupportedEncodingException e) {
                        throw new AssertionError("Unsopported encoding iso-8859-1 ??");
                }
+               finally {
+                       Util.nothrowClose(os);
+               }
        }
 
        @Override
@@ -84,11 +87,17 @@ public class FritzAddressbookExporter
                        gen_.end(); gen_.nl();
                        gen_.end();
                        gen_.endDocument();
+                       os_.close();
+                       os_ = null;
                }
                catch (SAXException e)
                {
                        throw new AssertionError("Invalid XML/SAX document generated.");
                }
+               finally
+               {
+                       Util.nothrowClose(os_);
+               }
        }
        
 }