Browse Source

Removing unused repository API method

pull/61/head
Martin Stockhammer 4 years ago
parent
commit
b942314aa2

+ 0
- 11
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java View File

@@ -30,17 +30,6 @@ public interface RepositoryContent
{


/**
* Given a repository relative path to a filename, return the {@link ArtifactReference} object suitable for the path.
*
* @param path the path relative to the repository base dir for the artifact.
* @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to
* a {@link ArtifactReference})
* @throws LayoutException if there was a problem converting the path to an artifact.
*/
ArtifactReference toArtifactReference( String path )
throws LayoutException;

/**
* Given an {@link ArtifactReference}, return the relative path to the artifact.
*

+ 0
- 6
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java View File

@@ -321,12 +321,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout
this.repository = repo;
}

@Override
public ArtifactReference toArtifactReference( String path ) throws LayoutException
{
return null;
}

@Override
public String toPath( ArtifactReference reference )
{

+ 0
- 6
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java View File

@@ -59,12 +59,6 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent
this.repository = repo;
}

@Override
public ArtifactReference toArtifactReference( String path ) throws LayoutException
{
return null;
}

@Override
public String toPath( ArtifactReference reference )
{

+ 0
- 24
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java View File

@@ -336,30 +336,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout

private Map<ArtifactReference, String> refs = new HashMap<>();

@Override
public ArtifactReference toArtifactReference( String path ) throws LayoutException
{
if ( StringUtils.isBlank( path ) )
{
throw new LayoutException( "Unable to convert blank path." );
}

ArtifactMetadata metadata = getArtifactForPath("test-repository", path);

ArtifactReference artifact = new ArtifactReference();
artifact.setGroupId( metadata.getNamespace() );
artifact.setArtifactId( metadata.getProject() );
artifact.setVersion( metadata.getVersion() );
MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID );
if ( facet != null )
{
artifact.setClassifier( facet.getClassifier() );
artifact.setType( facet.getType() );
}
refs.put(artifact, path);
return artifact;
}

public ArtifactMetadata getArtifactForPath( String repoId, String relativePath )
{
String[] parts = relativePath.replace( '\\', '/' ).split( "/" );

+ 0
- 25
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java View File

@@ -369,31 +369,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout

private Map<ArtifactReference, String> refs = new HashMap<>();

@Override
public ArtifactReference toArtifactReference( String path ) throws LayoutException
{
if ( StringUtils.isBlank( path ) )
{
throw new LayoutException( "Unable to convert blank path." );
}

ArtifactMetadata metadata = getArtifactForPath("test-repository", path);

ArtifactReference artifact = new ArtifactReference();
artifact.setGroupId( metadata.getNamespace() );
artifact.setArtifactId( metadata.getProject() );
artifact.setVersion( metadata.getVersion() );
artifact.setProjectVersion( metadata.getProjectVersion( ) );
MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID );
if ( facet != null )
{
artifact.setClassifier( facet.getClassifier() );
artifact.setType( facet.getType() );
}
refs.put(artifact, path);
return artifact;
}

public ArtifactMetadata getArtifactForPath( String repoId, String relativePath )
{
String[] parts = relativePath.replace( '\\', '/' ).split( "/" );

+ 0
- 6
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/RemoteRepositoryContentMock.java View File

@@ -65,12 +65,6 @@ public class RemoteRepositoryContentMock implements RemoteRepositoryContent
this.repository = repo;
}

@Override
public ArtifactReference toArtifactReference( String path ) throws LayoutException
{
return null;
}

@Override
public String toPath( ArtifactReference reference )
{

+ 0
- 7
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/AbstractDefaultRepositoryContent.java View File

@@ -77,13 +77,6 @@ public abstract class AbstractDefaultRepositoryContent implements RepositoryCont
this.artifactMappingProviders = artifactMappingProviders;
}

@Override
public ArtifactReference toArtifactReference( String path )
throws LayoutException
{
return defaultPathParser.toArtifactReference( path );
}

@Override
public ItemSelector toItemSelector( String path ) throws LayoutException
{

+ 0
- 30
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java View File

@@ -1597,36 +1597,6 @@ public class ManagedDefaultRepositoryContent
return repository.getRoot().getStorage( );
}

/**
* Convert a path to an artifact reference.
*
* @param path the path to convert. (relative or full location path)
* @throws LayoutException if the path cannot be converted to an artifact reference.
*/
@Override
public ArtifactReference toArtifactReference( String path )
throws LayoutException
{
String repoPath = convertUriToPath( repository.getLocation( ) );
if ( ( path != null ) && path.startsWith( repoPath ) && repoPath.length( ) > 0 )
{
return super.toArtifactReference( path.substring( repoPath.length( ) + 1 ) );
}
else
{
repoPath = path;
if ( repoPath != null )
{
while ( repoPath.startsWith( "/" ) )
{
repoPath = repoPath.substring( 1 );
}
}
return super.toArtifactReference( repoPath );
}
}


public void setFiletypes( FileTypes filetypes )
{
this.filetypes = filetypes;

+ 0
- 19
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContent.java View File

@@ -73,25 +73,6 @@ public class RemoteDefaultRepositoryContent
this.repository = repository;
}

/**
* Convert a path to an artifact reference.
*
* @param path the path to convert. (relative or full url path)
* @throws LayoutException if the path cannot be converted to an artifact reference.
*/
@Override
public ArtifactReference toArtifactReference( String path )
throws LayoutException
{

if ( ( path != null ) && repository.getLocation()!=null && path.startsWith( repository.getLocation().toString() ) )
{
return super.toArtifactReference( path.substring( repository.getLocation().toString().length( ) ) );
}

return super.toArtifactReference( path );
}

@Override
public RepositoryURL toURL( ArtifactReference reference )
{

Loading…
Cancel
Save