@@ -0,0 +1,2189 @@
+package org.apache.archiva.rest.services.utils;%0A/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Aimport net.sf.beanlib.provider.replicator.BeanReplicator;%0Aimport org.apache.archiva.rest.api.model.Artifact;%0Aimport org.apache.archiva.rest.api.model.TreeEntry;%0Aimport org.apache.maven.shared.dependency.tree.DependencyNode;%0Aimport org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;%0A%0Aimport java.util.List;%0A%0A/**%0A * @author Olivier Lamy%0A * @since 1.4-M3%0A */%0Apublic class TreeDependencyNodeVisitor%0A    implements DependencyNodeVisitor%0A%7B%0A%0A    final List%3CTreeEntry%3E treeEntries;%0A%0A    private TreeEntry currentEntry;%0A%0A    private DependencyNode firstNode;%0A%0A    public TreeDependencyNodeVisitor( List%3CTreeEntry%3E treeEntries )%0A    %7B%0A        this.treeEntries = treeEntries;%0A    %7D%0A%0A    public boolean visit( DependencyNode node )%0A    %7B%0A        TreeEntry entry = new TreeEntry( new BeanReplicator().replicateBean( node.getArtifact(), Artifact.class ) );%0A        entry.setParent( currentEntry );%0A        currentEntry = entry;%0A%0A        if ( firstNode == null )%0A        %7B%0A            firstNode = node;%0A            treeEntries.add( currentEntry );%0A        %7D%0A        else%0A        %7B%0A            currentEntry.getParent().getChilds().add( currentEntry );%0A        %7D%0A        return true;%0A    %7D%0A%0A    public boolean endVisit( DependencyNode node )%0A    %7B%0A        currentEntry = currentEntry.getParent();%0A        return true;%0A    %7D%0A%0A%7D%0A

extract inner class to a real class starting adding services for project generic metadatas.