transform this interface to use a bean request will ease future enhancements: add the bean request

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1401844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-10-24 19:50:33 +00:00
parent 4ba8af2e0e
commit 45ded60339
1 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,102 @@
package org.apache.archiva.proxy.common;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.HashMap;
import java.util.Map;
/**
* @author Olivier Lamy
* @since 1.4-M4
*/
public class WagonFactoryRequest
{
/**
* the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example
* <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b>
*/
private String protocol;
private Map<String, String> headers = new HashMap<String, String>();
private String userAgent = "Java-Archiva";
public WagonFactoryRequest()
{
// no op
}
public WagonFactoryRequest( String protocol, Map<String, String> headers )
{
this.protocol = protocol;
this.headers = headers;
}
public String getProtocol()
{
return protocol;
}
public void setProtocol( String protocol )
{
this.protocol = protocol;
}
public WagonFactoryRequest protocol( String protocol )
{
this.protocol = protocol;
return this;
}
public Map<String, String> getHeaders()
{
if ( this.headers == null )
{
this.headers = new HashMap<String, String>();
}
return headers;
}
public void setHeaders( Map<String, String> headers )
{
this.headers = headers;
}
public WagonFactoryRequest headers( Map<String, String> headers )
{
this.headers = headers;
return this;
}
public String getUserAgent()
{
return userAgent;
}
public void setUserAgent( String userAgent )
{
this.userAgent = userAgent;
}
public WagonFactoryRequest userAgent( String userAgent )
{
this.userAgent = userAgent;
return this;
}
}