IOUtils
Functions
Applies the consumer to all non-null elements in the collection. If the consumer throws an exception for one element, that exception is re-thrown after applying to all elements, and later exceptions are suppressed.
Closes all given AutoCloseables.:contentReferenceoaicite:0{index=0}
Closes all given AutoCloseables. Some of the objects may be null; they are ignored. After everything is closed, throws the first exception encountered, or completes normally if none.
Closes all given AutoCloseables, suppressing all thrown non-Error exceptions.:contentReferenceoaicite:1{index=1} Even if a VirtualMachineError (or equivalent fatal Error) is thrown, all given resources are closed.
Closes all given AutoCloseables, suppressing all thrown exceptions. Some of the objects may be null; they are ignored.
Deletes all given file names from a Directory.:contentReferenceoaicite:5{index=5} Some of the names may be null; they are ignored. After deletion, throws the first exception encountered (with others suppressed) if any failures occurred.
Deletes all given Paths if they exist. After deletion, throws the first exception encountered (others suppressed) if any deletion failed.
Deletes all given Paths if they exist. Some may be null; they are ignored. After deletion, throws the first exception encountered (others suppressed) if any deletion failed.
Deletes all given Paths, suppressing all thrown IOExceptions. Some of the paths may be null; they are ignored.
Deletes all given files in a Directory, suppressing all thrown IOExceptions. Note that the file names should not be null.
Deletes all given files in a Directory, suppressing all thrown IOExceptions.:contentReferenceoaicite:4{index=4}
Wrapping the given InputStream in a reader using a CharsetDecoder. Unlike Java's defaults this reader will throw an exception if your it detects the read charset doesn't match the expected Charset.
Wrap all calls to Class.getResource or Class.getResourceAsStream using this method to enforce existence of the resource. This code works around those methods returning null to signal non-existence.
Rethrows the argument unchecked (as is if it's an Error or RuntimeException, or wrapped in RuntimeException).