
Package ca.uhn.fhir.util
Class IoUtils
java.lang.Object
ca.uhn.fhir.util.IoUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseQuietly(AutoCloseable theCloseable) Replacement for the deprecated commons-lang method of the same name.static voidcloseQuietly(AutoCloseable theCloseable, org.slf4j.Logger theLog) Closes quietly logging exceptions if anystatic <T> Optional<T> Cast the object to the target class, returning an empty optional if it fails.
-
Method Details
-
closeQuietly
Replacement for the deprecated commons-lang method of the same name. Use sparingly since they are right that most uses of this should be replaced with try-with-resources -
closeQuietly
Closes quietly logging exceptions if any- Parameters:
theCloseable- Closeable instance to be closedtheLog- Logger to log a potential exception
-
safeCast
Cast the object to the target class, returning an empty optional if it fails.
-