public void generate(String path) { File skeleton; if (path != null && !path.isEmpty()) { skeleton = new File(path); } else { skeleton = new File("crowdin.yml"); } InputStream is = Commands.class.getResourceAsStream("/crowdin.yml"); Path destination = Paths.get(skeleton.toURI()); System.out.print(RESOURCE_BUNDLE.getString("command_generate_description") + " '" + destination + "'- "); try { Files.copy(is, destination); System.out.println(OK); } catch (FileAlreadyExistsException ex) { System.out.println(SKIPPED); System.out.println("File '" + destination + "' already exists."); if (this.isDebug) { ex.printStackTrace(); } } catch (Exception ex) { System.out.println(RESOURCE_BUNDLE.getString("error_generate")); if (this.isDebug) { ex.printStackTrace(); } } }