/src/main/java/org/htmlunit/html/XmlSerializer.java
try ( OutputStream file = Files.newOutputStream( fos.toPath( ) ) ) {
try ( OutputStream fos = Files.newOutputStream ( file.toPath ( ) ) ) {
if (enclosedPage != null) { if (enclosedPage.isHtmlPage()) { new XmlSerializer().save((HtmlPage) enclosedPage, file, true); } else { try (InputStream is = enclosedPage.getWebResponse().getContentAsStream()) { <extra_id_0> IOUtils.copyLarge(is, fos); } } } } srcAttr.setValue(file.getParentFile().getName() + FILE_SEPARATOR + file.getName());