1 package org.apache.maven.wagon.shared.http;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.http.client.methods.HttpUriRequest;
23
24
25
26
27 public class HttpConfiguration
28 {
29
30 private HttpMethodConfiguration all;
31
32 private HttpMethodConfiguration get;
33
34 private HttpMethodConfiguration put;
35
36 private HttpMethodConfiguration head;
37
38 private HttpMethodConfiguration mkcol;
39
40 public HttpMethodConfiguration getAll()
41 {
42 return all;
43 }
44
45 public HttpConfiguration setAll( HttpMethodConfiguration all )
46 {
47 this.all = all;
48 return this;
49 }
50
51 public HttpMethodConfiguration getGet()
52 {
53 return get;
54 }
55
56 public HttpConfiguration setGet( HttpMethodConfiguration get )
57 {
58 this.get = get;
59 return this;
60 }
61
62 public HttpMethodConfiguration getPut()
63 {
64 return put;
65 }
66
67 public HttpConfiguration setPut( HttpMethodConfiguration put )
68 {
69 this.put = put;
70 return this;
71 }
72
73 public HttpMethodConfiguration getHead()
74 {
75 return head;
76 }
77
78 public HttpConfiguration setHead( HttpMethodConfiguration head )
79 {
80 this.head = head;
81 return this;
82 }
83
84 public HttpMethodConfiguration getMkcol()
85 {
86 return mkcol;
87 }
88
89 public HttpConfiguration setMkcol( HttpMethodConfiguration mkcol )
90 {
91 this.mkcol = mkcol;
92 return this;
93 }
94
95 public HttpMethodConfiguration getMethodConfiguration( HttpUriRequest method )
96 {
97 switch ( method.getMethod() )
98 {
99 case "GET":
100 return ConfigurationUtils.merge( all, get );
101 case "PUT":
102 return ConfigurationUtils.merge( all, put );
103 case "HEAD":
104 return ConfigurationUtils.merge( all, head );
105 case "MKCOL":
106 return ConfigurationUtils.merge( all, mkcol );
107 default:
108 return all;
109 }
110 }
111
112 }