Copies bytes from an InputStream source to a file destination . The directories up to destination will be created if they don't already exist. destination will be overwritten if it already exists. The source stream is left open, e.g.
(final InputStream source, final File destination)
| 1549 | * @since 2.5 |
| 1550 | */ |
| 1551 | public static void copyToFile(final InputStream source, final File destination) throws IOException { |
| 1552 | final FileOutputStream output = openOutputStream(destination); |
| 1553 | try { |
| 1554 | IOUtils.copy(source, output); |
| 1555 | output.close(); // don't swallow close Exception if copy completes normally |
| 1556 | } finally { |
| 1557 | IOUtils.closeQuietly(output); |
| 1558 | } |
| 1559 | } |
| 1560 | |
| 1561 | //----------------------------------------------------------------------- |
| 1562 | /** |
no test coverage detected