static public List<Path> installBlazeBinaries(Path installDir) throws MessageOnlyException { if (Files.notExists(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " does not exist"); } if (!Files.isDirectory(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " is not a directory"); } if (!Files.isWritable(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " is not writable (run this as an Administor or with sudo?)"); } List<Path> installedFiles = new ArrayList<>(); if (System.getProperty("os.name").toLowerCase().contains("win")) { // install blaze.bat Path blazeBatFile = installDir.resolve("blaze.bat"); installResource("/bin/blaze.bat", blazeBatFile); installedFiles.add(blazeBatFile); } // for ming32 compat also install the *nix version Path blazeFile = installDir.resolve("blaze"); installResource("/bin/blaze", blazeFile); installedFiles.add(blazeFile); return installedFiles; }
List<Path> installedFiles = InstallHelper.installBlazeBinaries(installDir); for (Path installedFile : installedFiles) { System.out.println("Installed " + installedFile);
List<Path> installedFiles = InstallHelper.installBlazeBinaries(installDir); for (Path installedFile : installedFiles) { System.out.println("Installed " + installedFile);
static public List<Path> installBlazeBinaries(Path installDir) throws MessageOnlyException { if (Files.notExists(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " does not exist"); } if (!Files.isDirectory(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " is not a directory"); } if (!Files.isWritable(installDir)) { throw new MessageOnlyException("Install directory " + installDir + " is not writable (run this as an Administor or with sudo?)"); } List<Path> installedFiles = new ArrayList<>(); if (System.getProperty("os.name").toLowerCase().contains("win")) { // install blaze.bat Path blazeBatFile = installDir.resolve("blaze.bat"); installResource("/bin/blaze.bat", blazeBatFile); installedFiles.add(blazeBatFile); } // for ming32 compat also install the *nix version Path blazeFile = installDir.resolve("blaze"); installResource("/bin/blaze", blazeFile); installedFiles.add(blazeFile); return installedFiles; }