protected void writePidFile(File pidFile, long pid) throws IOException { Files.write(pid + "\n", pidFile); } }
protected void writePidFile(File pidFile, long pid) throws IOException { Files.write(pid + "\n", pidFile); } }
Files.write(source, outputFile);
@Override protected List<String> getCommandLine(Distribution distribution, PostgresConfig config, IExtractedFileSet exe) throws IOException { List<String> ret = new ArrayList<>(); ret.add(exe.executable().getAbsolutePath()); if (getConfig().credentials() != null) { final File pwFile = createTempFile(SubdirTempDir.defaultInstance(), "pwfile" + randomUUID()); pwFile.deleteOnExit(); Files.write(getConfig().credentials().password(), pwFile); ret.addAll(asList( "-A", "password", "-U", getConfig().credentials().username(), "--pwfile=" + pwFile.getAbsolutePath() )); } if (distribution.getPlatform() == Platform.Windows) { ret.addAll(config.getAdditionalInitDbParams()); } ret.add(config.storage().dbDir().getAbsolutePath()); if (distribution.getPlatform() != Platform.Windows) { ret.addAll(config.getAdditionalInitDbParams()); } return ret; }
@Override public File write(InputStream source, long size) throws IOException { File destination; switch (_entry.type()) { case Executable: try { destination=Files.createTempFile(_dirFactoryResult,executableName(_executableNaming, _entry)); } catch (FileAlreadyExistsException ex) { throw new ExecutableFileAlreadyExistsException(ex); } break; default: destination=Files.createTempFile(_dirFactoryResult,fileName(_entry)); break; } Files.write(source, size, destination); switch (_entry.type()) { case Executable: destination.setExecutable(true); break; } return destination; }
@Override public File write(InputStream source, long size) throws IOException { File destination; switch (_entry.type()) { case Executable: try { destination=Files.createTempFile(_dirFactoryResult,executableName(_executableNaming, _entry)); } catch (FileAlreadyExistsException ex) { throw new ExecutableFileAlreadyExistsException(ex); } break; default: destination=Files.createTempFile(_dirFactoryResult,fileName(_entry)); break; } Files.write(source, size, destination); switch (_entry.type()) { case Executable: destination.setExecutable(true); break; } return destination; }