/** * Dump a string to a file * * @param location where to write to * @param data the data to write * @throws IOException on any error */ public void dump(File location, String data) throws IOException { File parent = location.getParentFile(); if (!parent.exists()) { forceMkdir(parent); } try (Writer w = getWriter(location)) { w.write(data); } }
try (Writer writer = _ops.getWriter(file)) { yaml.dump(data, writer);
when(ops.fileExists(workerArtifacts)).thenReturn(true); when(ops.fileExists(workerRoot)).thenReturn(true); when(ops.getWriter(logMetadataFile)).thenReturn(yamlDump);
/** * Dump a string to a file * @param location where to write to * @param data the data to write * @throws IOException on any error */ public void dump(File location, String data) throws IOException { File parent = location.getParentFile(); if (!parent.exists()) { forceMkdir(parent); } try (Writer w = getWriter(location)) { w.write(data); } }
try (Writer writer = _ops.getWriter(file)) { yaml.dump(data, writer);