summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-rest
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml5
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java458
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArtifactTransferRequest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/TreeEntry.java85
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java4
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml6
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java25
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/TreeDependencyNodeVisitor.java98
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java2
17 files changed, 28 insertions, 673 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
index fc0d99471..405c90107 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
@@ -52,6 +52,11 @@
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-maven2-model</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-scanner</artifactId>
</dependency>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java
deleted file mode 100644
index 3baa0ce0a..000000000
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java
+++ /dev/null
@@ -1,458 +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.List;
-
-@XmlRootElement( name = "artifact" )
-public class Artifact
- implements Serializable
-{
- // The (optional) context for this result.
- private String context;
-
- // Basic hit, direct to non-artifact resource.
- private String url;
-
- // Advanced hit, reference to groupId.
- private String groupId;
-
- // Advanced hit, reference to artifactId.
- private String artifactId;
-
- private String repositoryId;
-
- private String version;
-
- /**
- * Plugin goal prefix (only if packaging is "maven-plugin")
- */
- private String prefix;
-
- /**
- * Plugin goals (only if packaging is "maven-plugin")
- */
- private List<String> goals;
-
- /**
- * contains osgi metadata Bundle-Version if available
- *
- * @since 1.4-M1
- */
- private String bundleVersion;
-
- /**
- * contains osgi metadata Bundle-SymbolicName if available
- *
- * @since 1.4-M1
- */
- private String bundleSymbolicName;
-
- /**
- * contains osgi metadata Export-Package if available
- *
- * @since 1.4-M1
- */
- private String bundleExportPackage;
-
- /**
- * contains osgi metadata Export-Service if available
- *
- * @since 1.4-M1
- */
- private String bundleExportService;
-
- /**
- * contains osgi metadata Bundle-Description if available
- *
- * @since 1.4-M1
- */
- private String bundleDescription;
-
- /**
- * contains osgi metadata Bundle-Name if available
- *
- * @since 1.4-M1
- */
- private String bundleName;
-
- /**
- * contains osgi metadata Bundle-License if available
- *
- * @since 1.4-M1
- */
- private String bundleLicense;
-
- /**
- * contains osgi metadata Bundle-DocURL if available
- *
- * @since 1.4-M1
- */
- private String bundleDocUrl;
-
- /**
- * contains osgi metadata Import-Package if available
- *
- * @since 1.4-M1
- */
- private String bundleImportPackage;
-
- /**
- * contains osgi metadata Require-Bundle if available
- *
- * @since 1.4-M1
- */
- private String bundleRequireBundle;
-
- private String classifier;
-
- private String packaging;
-
- /**
- * file extension of the artifact
- *
- * @since 1.4-M2
- */
- private String fileExtension;
-
- /**
- * human readable size : not available for all services
- * @since 1.4-M3
- */
- private String size;
-
- /**
- * @since 1.4-M3
- */
- private String type;
-
-
- /**
- * @since 1.4-M3
- */
- private String path;
-
- /**
- * concat of artifactId+'-'+version+'.'+type
- * @since 1.4-M3
- */
- private String id;
-
-
- public Artifact()
- {
- // no op
- }
-
- public Artifact( String groupId, String artifactId, String version )
- {
- this.artifactId = artifactId;
- this.groupId = groupId;
- this.version = version;
- }
-
- public String getGroupId()
- {
- return groupId;
- }
-
- public String getArtifactId()
- {
- return artifactId;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- public String getRepositoryId()
- {
- return repositoryId;
- }
-
- public void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- public void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- public void setRepositoryId( String repositoryId )
- {
- this.repositoryId = repositoryId;
- }
-
- public String getContext()
- {
- return context;
- }
-
- public void setContext( String context )
- {
- this.context = context;
- }
-
- public String getUrl()
- {
- return url;
- }
-
- public void setUrl( String url )
- {
- this.url = url;
- }
-
- public String getPrefix()
- {
- return prefix;
- }
-
- public void setPrefix( String prefix )
- {
- this.prefix = prefix;
- }
-
- public List<String> getGoals()
- {
- return goals;
- }
-
- public void setGoals( List<String> goals )
- {
- this.goals = goals;
- }
-
- public String getBundleVersion()
- {
- return bundleVersion;
- }
-
- public void setBundleVersion( String bundleVersion )
- {
- this.bundleVersion = bundleVersion;
- }
-
- public String getBundleSymbolicName()
- {
- return bundleSymbolicName;
- }
-
- public void setBundleSymbolicName( String bundleSymbolicName )
- {
- this.bundleSymbolicName = bundleSymbolicName;
- }
-
- public String getBundleExportPackage()
- {
- return bundleExportPackage;
- }
-
- public void setBundleExportPackage( String bundleExportPackage )
- {
- this.bundleExportPackage = bundleExportPackage;
- }
-
- public String getBundleExportService()
- {
- return bundleExportService;
- }
-
- public void setBundleExportService( String bundleExportService )
- {
- this.bundleExportService = bundleExportService;
- }
-
- public String getBundleDescription()
- {
- return bundleDescription;
- }
-
- public void setBundleDescription( String bundleDescription )
- {
- this.bundleDescription = bundleDescription;
- }
-
- public String getBundleName()
- {
- return bundleName;
- }
-
- public void setBundleName( String bundleName )
- {
- this.bundleName = bundleName;
- }
-
- public String getBundleLicense()
- {
- return bundleLicense;
- }
-
- public void setBundleLicense( String bundleLicense )
- {
- this.bundleLicense = bundleLicense;
- }
-
- public String getBundleDocUrl()
- {
- return bundleDocUrl;
- }
-
- public void setBundleDocUrl( String bundleDocUrl )
- {
- this.bundleDocUrl = bundleDocUrl;
- }
-
- public String getBundleImportPackage()
- {
- return bundleImportPackage;
- }
-
- public void setBundleImportPackage( String bundleImportPackage )
- {
- this.bundleImportPackage = bundleImportPackage;
- }
-
- public String getBundleRequireBundle()
- {
- return bundleRequireBundle;
- }
-
- public void setBundleRequireBundle( String bundleRequireBundle )
- {
- this.bundleRequireBundle = bundleRequireBundle;
- }
-
- public String getClassifier()
- {
- return classifier;
- }
-
- public void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
-
- public String getPackaging()
- {
- return packaging;
- }
-
- public void setPackaging( String packaging )
- {
- this.packaging = packaging;
- }
-
- public String getFileExtension()
- {
- return fileExtension;
- }
-
- public void setFileExtension( String fileExtension )
- {
- this.fileExtension = fileExtension;
- }
-
- public String getSize()
- {
- return size;
- }
-
- public void setSize( String size )
- {
- this.size = size;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType( String type )
- {
- this.type = type;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public void setPath( String path )
- {
- this.path = path;
- }
-
- public String getId()
- {
- return id;
- }
-
- public void setId( String id )
- {
- this.id = id;
- }
-
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append( "Artifact" );
- sb.append( "{context='" ).append( context ).append( '\'' );
- sb.append( ", url='" ).append( url ).append( '\'' );
- sb.append( ", groupId='" ).append( groupId ).append( '\'' );
- sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
- sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
- sb.append( ", version='" ).append( version ).append( '\'' );
- sb.append( ", prefix='" ).append( prefix ).append( '\'' );
- sb.append( ", goals=" ).append( goals );
- sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
- sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
- sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
- sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
- sb.append( ", bundleDescription='" ).append( bundleDescription ).append( '\'' );
- sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
- sb.append( ", bundleLicense='" ).append( bundleLicense ).append( '\'' );
- sb.append( ", bundleDocUrl='" ).append( bundleDocUrl ).append( '\'' );
- sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
- sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
- sb.append( ", classifier='" ).append( classifier ).append( '\'' );
- sb.append( ", packaging='" ).append( packaging ).append( '\'' );
- sb.append( ", fileExtension='" ).append( fileExtension ).append( '\'' );
- sb.append( ", size='" ).append( size ).append( '\'' );
- sb.append( ", type='" ).append( type ).append( '\'' );
- sb.append( ", path='" ).append( path ).append( '\'' );
- sb.append( ", id='" ).append( id ).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/ArtifactTransferRequest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArtifactTransferRequest.java
index 4bb367f46..6385cba4e 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArtifactTransferRequest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArtifactTransferRequest.java
@@ -18,6 +18,8 @@ package org.apache.archiva.rest.api.model;
* under the License.
*/
+import org.apache.archiva.maven2.model.Artifact;
+
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/TreeEntry.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/TreeEntry.java
deleted file mode 100644
index 0ac2713af..000000000
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/TreeEntry.java
+++ /dev/null
@@ -1,85 +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 org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-@XmlRootElement( name = "treeEntry" )
-public class TreeEntry
- implements Serializable
-{
-
- private List<TreeEntry> childs = new ArrayList<TreeEntry>();
-
- private Artifact artifact;
-
- @JsonIgnore
- private TreeEntry parent;
-
- public TreeEntry()
- {
- // no op
- }
-
- public TreeEntry( Artifact artifact )
- {
- this.artifact = artifact;
- }
-
-
- public Artifact getArtifact()
- {
- return artifact;
- }
-
- public void setArtifact( Artifact artifact )
- {
- this.artifact = artifact;
- }
-
- public List<TreeEntry> getChilds()
- {
- return childs;
- }
-
- public void setChilds( List<TreeEntry> childs )
- {
- this.childs = childs;
- }
-
- @JsonIgnore
- public TreeEntry getParent()
- {
- return parent;
- }
-
- @JsonIgnore
- public void setParent( TreeEntry parent )
- {
- this.parent = parent;
- }
-}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
index 539a4f135..d5584ff15 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
@@ -21,12 +21,12 @@ package org.apache.archiva.rest.api.services;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.redback.authorization.RedbackAuthorization;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactContent;
import org.apache.archiva.rest.api.model.ArtifactContentEntry;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.model.Entry;
-import org.apache.archiva.rest.api.model.TreeEntry;
+import org.apache.archiva.maven2.model.TreeEntry;
import org.apache.archiva.rest.api.model.VersionsList;
import javax.ws.rs.DELETE;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
index 406322e3a..a35ec80c6 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
@@ -21,7 +21,7 @@ package org.apache.archiva.rest.api.services;
import org.apache.archiva.redback.authorization.RedbackAuthorization;
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
import org.apache.archiva.security.common.ArchivaRoleConstants;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java
index c17448f3b..d48002949 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java
@@ -20,7 +20,7 @@ package org.apache.archiva.rest.api.services;
*/
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.GroupIdList;
import org.apache.archiva.rest.api.model.SearchRequest;
import org.apache.archiva.rest.api.model.StringList;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
index 9d054b565..d584e4fb2 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
@@ -85,6 +85,12 @@
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-scanner</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-maven2-model</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-authorization-api</artifactId>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
index 0a031ed95..38858ec0c 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
@@ -30,7 +30,7 @@ import org.apache.archiva.redback.rest.services.RedbackAuthenticationThreadLocal
import org.apache.archiva.redback.rest.services.RedbackRequestInformation;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.UserManager;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.security.AccessDeniedException;
import org.apache.archiva.security.ArchivaSecurityException;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
index 061f8e87f..ff075ee2e 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
@@ -22,6 +22,8 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.dependency.tree.maven2.DependencyTreeBuilder;
import org.apache.archiva.dependency.tree.maven2.Maven3DependencyTreeBuilder;
+import org.apache.archiva.maven2.model.Artifact;
+import org.apache.archiva.maven2.model.TreeEntry;
import org.apache.archiva.metadata.generic.GenericMetadataFacet;
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.model.MetadataFacet;
@@ -39,19 +41,16 @@ import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.RepositoryNotFoundException;
-import org.apache.archiva.rest.api.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactContent;
import org.apache.archiva.rest.api.model.ArtifactContentEntry;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.model.BrowseResultEntry;
import org.apache.archiva.rest.api.model.Entry;
-import org.apache.archiva.rest.api.model.TreeEntry;
import org.apache.archiva.rest.api.model.VersionsList;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.BrowseService;
import org.apache.archiva.rest.services.utils.ArtifactContentEntryComparator;
import org.apache.archiva.rest.services.utils.ArtifactDownloadInfoBuilder;
-import org.apache.archiva.rest.services.utils.TreeDependencyNodeVisitor;
import org.apache.archiva.security.ArchivaSecurityException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
@@ -427,25 +426,10 @@ public class DefaultBrowseService
{
List<String> selectedRepos = getSelectedRepos( repositoryId );
- List<TreeEntry> treeEntries = new ArrayList<TreeEntry>();
- TreeDependencyNodeVisitor treeDependencyNodeVisitor = new TreeDependencyNodeVisitor( treeEntries );
- /*
- try
- {
- dependencyTreeBuilder.buildDependencyTree( selectedRepos, groupId, artifactId, version,
- treeDependencyNodeVisitor );
- }
- catch ( DependencyTreeBuilderException e )
- {
- throw new ArchivaRestServiceException( e.getMessage(),
- Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e );
- }
- */
try
{
- maven3DependencyTreeBuilder.buildDependencyTree( selectedRepos, groupId, artifactId, version,
- treeDependencyNodeVisitor );
+ return maven3DependencyTreeBuilder.buildDependencyTree( selectedRepos, groupId, artifactId, version );
}
catch ( Exception e )
@@ -453,8 +437,7 @@ public class DefaultBrowseService
log.error( e.getMessage(), e );
}
- log.debug( "treeEntrie: {}", treeEntries );
- return treeEntries;
+ return Collections.emptyList();
}
public List<ManagedRepository> getUserRepositories()
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
index 333912f1d..99dc202b9 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
@@ -61,7 +61,7 @@ import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
import org.apache.archiva.repository.scanner.RepositoryScanner;
import org.apache.archiva.repository.scanner.RepositoryScannerException;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.RepositoriesService;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
index d33985117..ee2ce4cc3 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
@@ -26,7 +26,7 @@ import org.apache.archiva.indexer.search.SearchFields;
import org.apache.archiva.indexer.search.SearchResultHit;
import org.apache.archiva.indexer.search.SearchResultLimits;
import org.apache.archiva.indexer.search.SearchResults;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.Dependency;
import org.apache.archiva.rest.api.model.GroupIdList;
import org.apache.archiva.rest.api.model.SearchRequest;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java
index b569ac8e0..8e29e1d2a 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java
@@ -22,7 +22,7 @@ import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/TreeDependencyNodeVisitor.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/TreeDependencyNodeVisitor.java
deleted file mode 100644
index 22e4b0af2..000000000
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/TreeDependencyNodeVisitor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.apache.archiva.rest.services.utils;
-/*
- * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
-import org.apache.archiva.rest.api.model.Artifact;
-import org.apache.archiva.rest.api.model.TreeEntry;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
-import org.sonatype.aether.graph.DependencyVisitor;
-
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-public class TreeDependencyNodeVisitor
- implements DependencyNodeVisitor, DependencyVisitor
-{
-
- final List<TreeEntry> treeEntries;
-
- private TreeEntry currentEntry;
-
- private DependencyNode firstNode;
-
- private org.sonatype.aether.graph.DependencyNode firstDependencyNode;
-
- public TreeDependencyNodeVisitor( List<TreeEntry> treeEntries )
- {
- this.treeEntries = treeEntries;
- }
-
- public boolean visit( DependencyNode node )
- {
- TreeEntry entry = new TreeEntry( new BeanReplicator().replicateBean( node.getArtifact(), Artifact.class ) );
- entry.setParent( currentEntry );
- currentEntry = entry;
-
- if ( firstNode == null )
- {
- firstNode = node;
- treeEntries.add( currentEntry );
- }
- else
- {
- currentEntry.getParent().getChilds().add( currentEntry );
- }
- return true;
- }
-
- public boolean endVisit( DependencyNode node )
- {
- currentEntry = currentEntry.getParent();
- return true;
- }
-
- public boolean visitEnter( org.sonatype.aether.graph.DependencyNode dependencyNode )
- {
- TreeEntry entry = new TreeEntry( new BeanReplicator().replicateBean( dependencyNode.getDependency().getArtifact(), Artifact.class ) );
- entry.setParent( currentEntry );
- currentEntry = entry;
-
- if ( firstDependencyNode == null )
- {
- firstDependencyNode = dependencyNode;
- treeEntries.add( currentEntry );
- }
- else
- {
- currentEntry.getParent().getChilds().add( currentEntry );
- }
- return true;
- }
-
- public boolean visitLeave( org.sonatype.aether.graph.DependencyNode dependencyNode )
- {
- currentEntry = currentEntry.getParent();
- return true;
- }
-}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java
index 4f9c68ab5..825856f52 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java
@@ -19,7 +19,7 @@ package org.apache.archiva.rest.services;
*/
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactContentEntry;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.model.BrowseResultEntry;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
index 5198d6376..b784b29f4 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
@@ -21,7 +21,7 @@ package org.apache.archiva.rest.services;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.common.utils.FileUtil;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.model.BrowseResultEntry;
import org.apache.archiva.rest.api.model.VersionsList;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java
index c3a9cbc01..241d6900d 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java
@@ -19,7 +19,7 @@ package org.apache.archiva.rest.services;
*/
import org.apache.archiva.admin.model.beans.UiConfiguration;
-import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.rest.api.model.SearchRequest;
import org.apache.archiva.rest.api.services.SearchService;
import org.fest.assertions.api.Assertions;