コード例 #1
0
ファイル: FedoraHome.java プロジェクト: adam-vessey/fcrepo-1
  /**
   * Unpacks the contents of the FEDORA_HOME directory from the Distribution.
   *
   * @throws InstallationFailedException
   */
  private void unpack() throws InstallationFailedException {
    System.out.println("Preparing FEDORA_HOME...");

    if (!_installDir.exists() && !_installDir.mkdirs()) {
      throw new InstallationFailedException(
          "Unable to create FEDORA_HOME: " + _installDir.getAbsolutePath());
    }
    if (!_installDir.isDirectory()) {
      throw new InstallationFailedException(_installDir.getAbsolutePath() + " is not a directory");
    }
    try {
      Zip.unzip(_dist.get(Distribution.FEDORA_HOME), _installDir);
      setScriptsExecutable(new File(_installDir, "client" + File.separator + "bin"));

      File serverDir = new File(_installDir, "server");
      if (_clientOnlyInstall) {
        FileUtils.delete(serverDir);
      } else {
        setScriptsExecutable(new File(serverDir, "bin"));
      }
    } catch (IOException e) {
      throw new InstallationFailedException(e.getMessage(), e);
    }
  }