class CreateProject extends AbstractCommand implements Command {

  @Override
  public void execute() throws Exception {
    logger.debug("Starting {} with {}...", this, arguments);

    final Options options = parse(new Options());
    final Path projectPath = getProjectHome();
    final String projectPathStr = getProjectHomePath();
    final Path projectFilePath = getProjectFile();
    final String projectFilePathStr = getProjectFilePath();

    final WriteProjectFile writeProjectFile = new WriteProjectFile();
    final String projectDirectoryName = getFilename(projectPathStr);
    if (!options.isForce() && 0 < Files.list(projectPath).count()) {
      logger.trace("Force: {}", options.isForce());
      throw new DirectoryNotEmptyException(projectPath);
    }
    final String projectName = System.getProperty("user.name") + "/" + projectDirectoryName;
    final ProjectFile newProjectFile = newProjectFile(projectName);
    prepare(newProjectFile);
    writeProjectFile.setProject(newProjectFile);
    writeProjectFile.setArguments(singletonList(projectFilePathStr));
    writeProjectFile.execute();

    printer.println(bind(NL_0, projectPathStr));
    try (
        final InputStream in = Files.newInputStream(projectFilePath);
        final Reader reader = new InputStreamReader(in)) {
      printer.println(bind(NL_1, projectFilePathStr));
      printer.println(IoUtils.from(reader));
    }
  }

}