[java-metadata-aggregator COMMIT] in /trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom: DomFilesys...

noreply at shibboleth.net noreply at shibboleth.net
Sat Jun 29 16:41:11 EDT 2013


Author: iay
Date: Sat Jun 29 16:41:11 2013
New Revision: 238

URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=238&view=rev
Log:
Remove deprecated Guava Closeables.closeQuietly calls.

Modified:
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java?rev=238&r1=237&r2=238&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java Sat Jun 29 16:41:11 2013
@@ -20,6 +20,7 @@
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -40,8 +41,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
-
-import com.google.common.io.Closeables;
 
 /**
  * A stage which reads XML information from the filesystem and places it in the given {@link DomElementItem} collection.
@@ -296,7 +295,11 @@
                 return null;
             }
         } finally {
-            Closeables.closeQuietly(xmlIn);
+            try {
+                xmlIn.close();
+            } catch (IOException e) {
+                throw new StageProcessingException("Exception closing input stream", e);
+            }
         }
     }
 

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java?rev=238&r1=237&r2=238&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java Sat Jun 29 16:41:11 2013
@@ -17,6 +17,7 @@
 
 package net.shibboleth.metadata.dom;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
 
@@ -37,8 +38,6 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-import com.google.common.io.Closeables;
 
 /**
  * A pipeline stage which reads an XML document from an {@link Resource}, parses the document, and places the resultant
@@ -150,13 +149,18 @@
             }
         } catch (ResourceException e) {
             if (errorCausesSourceFailure) {
-                throw new StageProcessingException("Error retrieving XML document from " + domResource.getLocation(), e);
+                throw new StageProcessingException("Error retrieving XML document from " +
+                        domResource.getLocation(), e);
             } else {
                 log.warn("stage {}: unable to read in XML file");
                 log.debug("stage {}: HTTP resource exception", getId(), e);
             }
         } finally {
-            Closeables.closeQuietly(ins);
+            try {
+                ins.close();
+            } catch (IOException e) {
+                throw new StageProcessingException("Error closing resource", e);
+            }
         }
     }
 



More information about the commits mailing list