diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-15 19:53:24 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-15 19:53:24 +0000 |
commit | 0396658ae606b76be7ad24f584d28a3a52cdeb9b (patch) | |
tree | d8ce07c4f05ec184c20784be8bb1cd9cd5166981 | |
parent | de356181282bb1eb5388a7aaf71d181084d779c1 (diff) | |
download | archiva-0396658ae606b76be7ad24f584d28a3a52cdeb9b.tar.gz archiva-0396658ae606b76be7ad24f584d28a3a52cdeb9b.zip |
[MRM-1520] remove duplicate beans : fix for ArchivaAdministration service
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171245 13f79535-47bb-0310-9956-ffa450edef68
6 files changed, 9 insertions, 349 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java deleted file mode 100644 index 489c4568c..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.apache.archiva.rest.api.model; -/* - * 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 javax.xml.bind.annotation.XmlRootElement; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Olivier Lamy - * @since 1.4 - */ -@XmlRootElement( name = "fileType" ) -public class FileType - implements Serializable -{ - /** - * Field id. - */ - private String id; - - /** - * Field patterns. - */ - private List<String> patterns; - - public FileType() - { - // no op - } - - public FileType( String id, List<String> patterns ) - { - this.id = id; - this.patterns = patterns; - } - - public String getId() - { - return id; - } - - public void setId( String id ) - { - this.id = id; - } - - public List<String> getPatterns() - { - if ( patterns == null ) - { - this.patterns = new ArrayList<String>(); - } - return patterns; - } - - public void setPatterns( List<String> patterns ) - { - this.patterns = patterns; - } - - public void addPattern( String pattern ) - { - getPatterns().add( pattern ); - } - - public void removePattern( String pattern ) - { - getPatterns().remove( pattern ); - } - - @Override - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - if ( o == null || getClass() != o.getClass() ) - { - return false; - } - - FileType fileType = (FileType) o; - - if ( id != null ? !id.equals( fileType.id ) : fileType.id != null ) - { - return false; - } - - return true; - } - - @Override - public int hashCode() - { - return id != null ? 37 + id.hashCode() : 0; - } - - @Override - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append( "FileType" ); - sb.append( "{id='" ).append( id ).append( '\'' ); - sb.append( ", patterns=" ).append( patterns ); - sb.append( '}' ); - return sb.toString(); - } -} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/LegacyArtifactPath.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/LegacyArtifactPath.java deleted file mode 100644 index d5e64cf9c..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/LegacyArtifactPath.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.apache.archiva.rest.api.model; -/* - * 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 javax.xml.bind.annotation.XmlRootElement; -import java.io.Serializable; - -/** - * @author Olivier Lamy - * @since 1.4 - */ -@XmlRootElement( name = "legacyArtifactPath" ) -public class LegacyArtifactPath - implements Serializable -{ - /** - * The legacy path. - */ - private String path; - - /** - * The artifact reference, as " [groupId] : - * [artifactId] : [version] : [classifier] : [type] ". - */ - private String artifact; - - public LegacyArtifactPath() - { - // no op - } - - public LegacyArtifactPath( String path, String artifact ) - { - this.path = path; - this.artifact = artifact; - } - - public String getPath() - { - return path; - } - - public void setPath( String path ) - { - this.path = path; - } - - public String getArtifact() - { - return artifact; - } - - public void setArtifact( String artifact ) - { - this.artifact = artifact; - } - - public boolean match( String path ) - { - return path.equals( this.path ); - } - - public String getGroupId() - { - return artifact.split( ":" )[0]; - } - - public String getArtifactId() - { - return artifact.split( ":" )[1]; - } - - public String getVersion() - { - return artifact.split( ":" )[2]; - } - - public String getClassifier() - { - String classifier = artifact.split( ":" )[3]; - return classifier.length() > 0 ? classifier : null; - } - - public String getType() - { - return artifact.split( ":" )[4]; - } - - @Override - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append( "LegacyArtifactPath" ); - sb.append( "{path='" ).append( path ).append( '\'' ); - sb.append( ", artifact='" ).append( artifact ).append( '\'' ); - sb.append( '}' ); - return sb.toString(); - } -} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/OrganisationInformation.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/OrganisationInformation.java deleted file mode 100644 index 648823c8d..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/OrganisationInformation.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.apache.archiva.rest.api.model; -/* - * 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 javax.xml.bind.annotation.XmlRootElement; - -/** - * @author Olivier Lamy - * @since 1.4 - */ -@XmlRootElement( name = "organisationInformation" ) -public class OrganisationInformation -{ - /** - * name of the organisation. - */ - private String name; - - /** - * name of the organisation. - */ - private String url; - - /** - * name of the organisation. - */ - private String logoLocation; - - public OrganisationInformation() - { - // no op - } - - public OrganisationInformation( String name, String url, String logoLocation ) - { - this.name = name; - this.url = url; - this.logoLocation = logoLocation; - } - - public String getName() - { - return name; - } - - public void setName( String name ) - { - this.name = name; - } - - public String getUrl() - { - return url; - } - - public void setUrl( String url ) - { - this.url = url; - } - - public String getLogoLocation() - { - return logoLocation; - } - - public void setLogoLocation( String logoLocation ) - { - this.logoLocation = logoLocation; - } - - @Override - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append( "OrganisationInformation" ); - sb.append( "{name='" ).append( name ).append( '\'' ); - sb.append( ", url='" ).append( url ).append( '\'' ); - sb.append( ", logoLocation='" ).append( logoLocation ).append( '\'' ); - sb.append( '}' ); - return sb.toString(); - } -} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java index 19f9c7f79..58d7d53c1 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java @@ -18,9 +18,9 @@ package org.apache.archiva.rest.api.services; * under the License. */ -import org.apache.archiva.rest.api.model.FileType; -import org.apache.archiva.rest.api.model.LegacyArtifactPath; -import org.apache.archiva.rest.api.model.OrganisationInformation; +import org.apache.archiva.admin.model.beans.FileType; +import org.apache.archiva.admin.model.beans.LegacyArtifactPath; +import org.apache.archiva.admin.model.beans.OrganisationInformation; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.codehaus.plexus.redback.authorization.RedbackAuthorization; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java index 275cdc02d..f3e5e4108 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java @@ -21,9 +21,9 @@ package org.apache.archiva.rest.services; import net.sf.beanlib.provider.replicator.BeanReplicator; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.admin.ArchivaAdministration; -import org.apache.archiva.rest.api.model.FileType; -import org.apache.archiva.rest.api.model.LegacyArtifactPath; -import org.apache.archiva.rest.api.model.OrganisationInformation; +import org.apache.archiva.admin.model.beans.FileType; +import org.apache.archiva.admin.model.beans.LegacyArtifactPath; +import org.apache.archiva.admin.model.beans.OrganisationInformation; import org.apache.archiva.rest.api.services.ArchivaAdministrationService; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.springframework.stereotype.Service; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ArchivaAdministrationServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ArchivaAdministrationServiceTest.java index c6656fc31..49725d81b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ArchivaAdministrationServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ArchivaAdministrationServiceTest.java @@ -18,9 +18,9 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.rest.api.model.FileType; -import org.apache.archiva.rest.api.model.LegacyArtifactPath; -import org.apache.archiva.rest.api.model.OrganisationInformation; +import org.apache.archiva.admin.model.beans.FileType; +import org.apache.archiva.admin.model.beans.LegacyArtifactPath; +import org.apache.archiva.admin.model.beans.OrganisationInformation; import org.apache.commons.lang.StringUtils; import org.junit.Test; |