Ejemplo n.º 1
0
  /**
   * 코드저장소 프로젝트명을 변경하고 결과를 반환한다.
   *
   * @param projectName
   * @return 코드저장소 이름 변경성공시 true / 실패시 false
   */
  @Override
  public boolean renameTo(String projectName) {

    File src = new File(getRepoPrefix() + this.ownerName + "/" + this.projectName);
    File dest = new File(getRepoPrefix() + this.ownerName + "/" + projectName);
    src.setWritable(true);

    return src.renameTo(dest);
  }
Ejemplo n.º 2
0
  public boolean move(
      String srcProjectOwner,
      String srcProjectName,
      String desrProjectOwner,
      String destProjectName) {
    File src = new File(getRootDirectory(), srcProjectOwner + "/" + srcProjectName);
    File dest = new File(getRootDirectory(), desrProjectOwner + "/" + destProjectName);
    src.setWritable(true);

    try {
      if (src.exists()) {
        FileUtils.moveDirectory(src, dest);
      }
      return true;
    } catch (IOException e) {
      play.Logger.error("Move Failed", e);
      return false;
    }
  }