public static File createTempFile(String prefix, String suffix) throws IOException { return createTempFile(prefix, suffix, null, false); }
public static File createTempFile(String prefix, String suffix) throws IOException { return createTempFile(prefix, suffix, null, false); }
public static File createTempFile(String prefix, String suffix) throws IOException { return createTempFile(prefix, suffix, null, false); }
public static File createTempFile(String prefix, String suffix) throws IOException { return createTempFile(prefix, suffix, null, false); }
public static File createTempFile(String prefix, String suffix) throws IOException { return createTempFile(prefix, suffix, null, false); }
private String[] createForkOnceArgs(List<List<String>> wargs) throws MojoExecutionException { try { File f = FileUtils.createTempFile("cxf-w2j", "args"); PrintWriter fw = new PrintWriter(new FileWriter(f)); for (List<String> args : wargs) { fw.println(Integer.toString(args.size())); for (String s : args) { fw.println(s); } } fw.println("-1"); fw.close(); return new String[] {f.getAbsolutePath()}; } catch (IOException ex) { throw new MojoExecutionException("Could not create argument file", ex); } }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttribute("schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private String[] createForkOnceArgs(List<List<String>> wargs) throws MojoExecutionException { try { File f = FileUtils.createTempFile("cxf-w2j", "args"); PrintWriter fw = new PrintWriter(new FileWriter(f)); for (List<String> args : wargs) { fw.println(Integer.toString(args.size())); for (String s : args) { fw.println(s); } } fw.println("-1"); fw.close(); return new String[] { f.getAbsolutePath() }; } catch (IOException ex) { throw new MojoExecutionException("Could not create argument file", ex); } }
private void checkLongClasspath(String classpath, List<String> list, int classpathIdx) { if (isLongClasspath(classpath)) { PrintWriter out = null; try { classpathTmpFile = FileUtils.createTempFile("cxf-compiler-classpath", null); out = new PrintWriter(new FileWriter(classpathTmpFile)); out.println(classpath); out.flush(); out.close(); list.set(classpathIdx + 1, "@" + classpathTmpFile); } catch (IOException e) { System.err.print("[ERROR] can't write long classpath to @argfile"); } } }
private void checkLongClasspath(String classpath, List<String> list, int classpathIdx) { if (isLongClasspath(classpath)) { PrintWriter out = null; try { classpathTmpFile = FileUtils.createTempFile("cxf-compiler-classpath", null); out = new PrintWriter(new FileWriter(classpathTmpFile)); out.println(classpath); out.flush(); out.close(); list.set(classpathIdx + 1, "@" + classpathTmpFile); } catch (IOException e) { System.err.print("[ERROR] can't write long classpath to @argfile"); } } }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private void checkLongClasspath(String classpath, List<String> list, int classpathIdx) { if (isLongClasspath(classpath)) { PrintWriter out = null; try { classpathTmpFile = FileUtils.createTempFile("cxf-compiler-classpath", null); out = new PrintWriter(new FileWriter(classpathTmpFile)); out.println(classpath); out.flush(); out.close(); list.set(classpathIdx + 1, "@" + classpathTmpFile); } catch (IOException e) { System.err.print("[ERROR] can't write long classpath to @argfile"); } } }
private void checkLongClasspath(String classpath, List<String> list, int classpathIdx) { if (isLongClasspath(classpath)) { PrintWriter out = null; try { classpathTmpFile = FileUtils.createTempFile("cxf-compiler-classpath", null); out = new PrintWriter(new FileWriter(classpathTmpFile)); out.println(classpath); out.flush(); out.close(); list.set(classpathIdx + 1, "@" + classpathTmpFile); } catch (IOException e) { System.err.print("[ERROR] can't write long classpath to @argfile"); } } }
private void checkLongClasspath(String classpath, List<String> list, int classpathIdx) { if (isLongClasspath(classpath)) { PrintWriter out = null; try { classpathTmpFile = FileUtils.createTempFile("cxf-compiler-classpath", null); out = new PrintWriter(new FileWriter(classpathTmpFile)); out.println(classpath); out.flush(); out.close(); list.set(classpathIdx + 1, "@" + classpathTmpFile); } catch (IOException e) { System.err.print("[ERROR] can't write long classpath to @argfile"); } } }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private String[] createForkOnceArgs(List<List<String>> wargs) throws MojoExecutionException { try { File f = FileUtils.createTempFile("cxf-w2j", "args"); PrintWriter fw = new PrintWriter(new FileWriter(f)); for (List<String> args : wargs) { fw.println(Integer.toString(args.size())); for (String s : args) { fw.println(s); } } fw.println("-1"); fw.close(); return new String[] { f.getAbsolutePath() }; } catch (IOException ex) { throw new MojoExecutionException("Could not create argument file", ex); } }
private void createFileOutputStream() throws IOException { if (tempFileFailed) { return; } ByteArrayOutputStream bout = (ByteArrayOutputStream)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStream(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
private void createFileOutputStream() throws IOException { if (tempFileFailed) { return; } LoadingCharArrayWriter bout = (LoadingCharArrayWriter)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStreamWriter(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
private File getSOAPBodyFile(Document doc) throws Exception { File file = FileUtils.createTempFile("cxf-systest", "xml"); try (FileOutputStream out = new FileOutputStream(file)) { XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out); StaxUtils.writeDocument(doc, writer, true); writer.close(); return file; } }