コード例 #1
0
 private Message moveResourceToCollection(
     final Resource source, final Resource destination, final boolean overwrite)
     throws IOException {
   if (overwrite) {
     destination.delete();
   }
   source.moveTo(destination);
   return overwrite ? successNoContent() : successCreated();
 }
コード例 #2
0
  private Response doDelete(Environment env) {
    final Resource resource = resolveResource(env.pathInfo());

    //		if (fragment != null) {
    //			return clientErrorMethodNotAllowed();
    //		} else {
    if (resource.isLocked()) {
      return clientErrorLocked();
    }
    if (resource.exists()) {
      if (resource.isLocked()) {
        return clientErrorLocked();
      } else {
        if (resource.isCollection()) {
          return (resource.delete() ? successNoContent() : serverErrorInternal());
        } else {
          return (resource.delete() ? successNoContent() : serverErrorInternal());
        }
      }
    } else {
      return clientErrorNotFound();
    }
    //		}
  }