List of usage examples for javax.xml.transform TransformerException getStackTrace
public StackTraceElement[] getStackTrace()
From source file:org.forgerock.doc.maven.ImageDataTransformer.java
/** * Update files that match, adding them to the results. * * @param file/*www . j a va 2 s. c o m*/ * File to update * @param depth * Not used * @param results * List of files updated * @throws IOException * Something went wrong changing a file's content. */ @Override protected final void handleFile(final File file, final int depth, final Collection<File> results) throws IOException { if (file.isFile()) { try { Source xml = new StreamSource(file); File tmpFile = File.createTempFile(file.getName(), ".tmp"); transformer.transform(xml, new StreamResult(tmpFile)); FileUtils.deleteQuietly(file); FileUtils.moveFile(tmpFile, file); results.add(file); } catch (TransformerException te) { throw new IOException("Failed to transform " + file.getPath() + ": " + te.getStackTrace()); } } }