diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-24 19:50:33 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-24 19:50:33 +0000 |
commit | 45ded60339d7ed394643853b54d24f17a9d16d04 (patch) | |
tree | 0565d26223cc083b269f85d6584433477d461079 /archiva-modules/archiva-base/archiva-proxy-common/src/main | |
parent | 4ba8af2e0ed8cb7395678da0814ecc9c914c60cc (diff) | |
download | archiva-45ded60339d7ed394643853b54d24f17a9d16d04.tar.gz archiva-45ded60339d7ed394643853b54d24f17a9d16d04.zip |
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
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy-common/src/main')
-rw-r--r-- | archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java new file mode 100644 index 000000000..ea6c5efa0 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java @@ -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; + } +} |