1 19 20 package com.maverick.http; 21 22 import java.io.IOException ; 23 24 28 public class CopyMethod extends HttpMethod { 29 30 String toURI; 31 boolean overwrite = false; 32 33 public CopyMethod(String uri, String toURI, boolean overwrite) { 34 this("COPY", uri, toURI, overwrite); } 36 37 CopyMethod(String name, String uri, String toURI, boolean overwrite) { 38 super(name, uri); 39 this.toURI = toURI; 40 this.overwrite = overwrite; 41 } 42 43 public HttpResponse execute(HttpRequest request, HttpConnection con) throws IOException { 44 45 request.setHeaderField("Destination", toURI); request.setHeaderField("Overwrite", overwrite ? "T" : "F"); return super.execute(request, con); 48 } 49 } 50 | Popular Tags |