]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.support/src/org/argeo/slc/aether/spring/RemoteRepositoryFactory.java
069e4c3e4ee055952d61e1a09662adc331183f4a
2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.aether
.spring
;
18 import org
.eclipse
.aether
.repository
.Authentication
;
19 import org
.eclipse
.aether
.repository
.RemoteRepository
;
20 import org
.springframework
.beans
.factory
.BeanNameAware
;
21 import org
.springframework
.beans
.factory
.FactoryBean
;
23 /** Simplifies the definition of a remote factory using Spring */
24 public class RemoteRepositoryFactory
implements BeanNameAware
, FactoryBean
{
25 private String beanName
;
28 private String type
= "default";
29 private String username
;
30 private String password
;
32 public Object
getObject() throws Exception
{
33 // FIXME Adapt to changes in Aether
34 // RemoteRepository remoteRepository = new RemoteRepository(
35 // id != null ? id : beanName, type, url);
36 // if (username != null) {
37 // Authentication authentication = new Authentication(username,
39 // remoteRepository.setAuthentication(authentication);
44 public Class
<?
> getObjectType() {
45 return RemoteRepository
.class;
48 public boolean isSingleton() {
52 public void setBeanName(String name
) {
57 public void setId(String id
) {
61 public void setUrl(String url
) {
65 public void setType(String type
) {
69 public void setUsername(String username
) {
70 this.username
= username
;
73 public void setPassword(String password
) {
74 this.password
= password
;