Example #1
0
 @Override
 public void sendError(int statusCode, String msg) throws IOException {
   // FIXME response should be returned at this time.
   setStatus(statusCode);
   resetBuffer();
   if (msg != null) {
     play.Logger.error(msg);
     getWriter().write(msg);
     response.setHeader(Http.HeaderNames.CONTENT_TYPE, "text/plain");
   } else {
     response.getHeaders().remove(Http.HeaderNames.CONTENT_TYPE);
   }
 }
Example #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;
    }
  }