List of usage examples for org.springframework.boot.loader.tools LaunchScript toByteArray
byte[] toByteArray();
From source file:org.springframework.boot.loader.tools.JarWriter.java
/** * Create a new {@link JarWriter} instance. * @param file the file to write//from w w w .j a v a2 s .c o m * @param launchScript an optional launch script to prepend to the front of the jar * @throws IOException if the file cannot be opened * @throws FileNotFoundException if the file cannot be found */ public JarWriter(File file, LaunchScript launchScript) throws FileNotFoundException, IOException { FileOutputStream fileOutputStream = new FileOutputStream(file); if (launchScript != null) { fileOutputStream.write(launchScript.toByteArray()); setExecutableFilePermission(file); } this.jarOutput = new JarArchiveOutputStream(fileOutputStream); this.jarOutput.setEncoding("UTF-8"); }