r102 - trunk/coser-business/src/main/java/fr/ifremer/coser/services
Author: chatellier Date: 2010-10-26 08:53:49 +0000 (Tue, 26 Oct 2010) New Revision: 102 Log: Use close (closeable) from commons-io 2.0 Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2010-10-25 16:22:54 UTC (rev 101) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2010-10-26 08:53:49 UTC (rev 102) @@ -135,13 +135,7 @@ throw new CoserBusinessException("Can't read file", ex); } finally { - if (csvReader != null) { - try { - csvReader.close(); - } catch (IOException ex) { - throw new CoserBusinessException("Can't close file", ex); - } - } + IOUtils.closeQuietly(csvReader); IOUtils.closeQuietly(reader); } @@ -270,13 +264,7 @@ throw new CoserBusinessException("Can't save data", ex); } finally { - if (csvWriter != null) { - try { - csvWriter.close(); - } catch (IOException ex) { - throw new CoserBusinessException("Can't close file", ex); - } - } + IOUtils.closeQuietly(csvWriter); IOUtils.closeQuietly(writer); } }
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org