1 package org.apache.archiva.proxy.common;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import java.util.HashMap;
25 * @author Olivier Lamy
28 public class WagonFactoryRequest
31 * the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example
32 * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b>
34 private String protocol;
36 private Map<String, String> headers = new HashMap<String, String>();
38 private String userAgent = "Java-Archiva";
40 public WagonFactoryRequest()
45 public WagonFactoryRequest( String protocol, Map<String, String> headers )
47 this.protocol = protocol;
48 this.headers = headers;
51 public String getProtocol()
56 public void setProtocol( String protocol )
58 this.protocol = protocol;
61 public WagonFactoryRequest protocol( String protocol )
63 this.protocol = protocol;
67 public Map<String, String> getHeaders()
69 if ( this.headers == null )
71 this.headers = new HashMap<String, String>();
76 public void setHeaders( Map<String, String> headers )
78 this.headers = headers;
81 public WagonFactoryRequest headers( Map<String, String> headers )
83 this.headers = headers;
87 public String getUserAgent()
92 public void setUserAgent( String userAgent )
94 this.userAgent = userAgent;
97 public WagonFactoryRequest userAgent( String userAgent )
99 this.userAgent = userAgent;
104 public boolean equals( Object o )
110 if ( !( o instanceof WagonFactoryRequest ) )
115 WagonFactoryRequest that = (WagonFactoryRequest) o;
117 if ( protocol != null ? !protocol.equals( that.protocol ) : that.protocol != null )
121 if ( userAgent != null ? !userAgent.equals( that.userAgent ) : that.userAgent != null )
130 public int hashCode()
132 int result = protocol != null ? protocol.hashCode() : 0;
133 result = 31 * result + ( userAgent != null ? userAgent.hashCode() : 0 );