Removing unused repository API method

This commit is contained in:
Martin Stockhammer 2020-06-07 19:32:53 +02:00
parent aa8de8c74b
commit b942314aa2
9 changed files with 0 additions and 134 deletions

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.
*

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 )
{

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 )
{

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( "/" );

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( "/" );

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 )
{

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
{

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;

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 )
{