Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use constants

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information...
commit b9ffa50c41e4d76cc3de488e4a6aadcf22428db2 1 parent d98a61d
@adreghiciu adreghiciu authored
Showing with 47 additions and 19 deletions.
  1. +6 −2 ...rc/main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyGroupRepository.java
  2. +4 −0 .../java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyGroupRepositoryFactory.java
  3. +6 −2 ...c/main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyHostedRepository.java
  4. +1 −1  ...java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyHostedRepositoryFactory.java
  5. +6 −2 ...rc/main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepository.java
  6. +1 −1  .../java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepositoryFactory.java
  7. +6 −2 ...c/main/java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyShadowRepository.java
  8. +1 −1  ...java/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyShadowRepositoryFactory.java
  9. +3 −1 ...a/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenGroupRepository.java
  10. +1 −1  ...onatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenGroupRepositoryFactory.java
  11. +3 −1 .../org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenHostedRepository.java
  12. +1 −1  ...natype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenHostedRepositoryFactory.java
  13. +3 −1 ...a/org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenProxyRepository.java
  14. +1 −1  ...onatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenProxyRepositoryFactory.java
  15. +3 −1 .../org/sonatype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenShadowRepository.java
  16. +1 −1  ...natype/nexus/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenShadowRepositoryFactory.java
View
8 ...onatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyGroupRepository.java
@@ -27,6 +27,10 @@
implements GroupRepository<T>
{
+ static final String REPO_TYPE = "group";
+
+ static final String PROVIDER_ROLE = "org.sonatype.nexus.proxy.repository.GroupRepository";
+
public JerseyGroupRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -42,8 +46,8 @@ protected RepositoryGroupResource createSettings()
{
final RepositoryGroupResource settings = new RepositoryGroupResource();
- settings.setRepoType( "group" );
- settings.setProviderRole( "org.sonatype.nexus.proxy.repository.GroupRepository" );
+ settings.setRepoType( REPO_TYPE );
+ settings.setProviderRole( PROVIDER_ROLE );
settings.setExposed( true );
return settings;
View
4 .../nexus/client/internal/rest/jersey/subsystem/repository/JerseyGroupRepositoryFactory.java
@@ -39,6 +39,10 @@ public int canAdapt( final RepositoryBaseResource resource )
{
score++;
}
+ if ( JerseyGroupRepository.REPO_TYPE.equals( resource.getRepoType() ) )
+ {
+ score++;
+ }
return score;
}
View
8 ...natype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyHostedRepository.java
@@ -25,6 +25,10 @@
implements HostedRepository<T>
{
+ static final String REPO_TYPE = "hosted";
+
+ static final String PROVIDER_ROLE = "org.sonatype.nexus.proxy.repository.Repository";
+
public JerseyHostedRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -40,8 +44,8 @@ protected RepositoryResource createSettings()
{
final RepositoryResource settings = new RepositoryResource();
- settings.setRepoType( "hosted" );
- settings.setProviderRole( "org.sonatype.nexus.proxy.repository.Repository" );
+ settings.setRepoType( REPO_TYPE );
+ settings.setProviderRole( PROVIDER_ROLE );
settings.setExposed( true );
settings.setWritePolicy( "ALLOW_WRITE_ONCE" );
settings.setBrowseable( true );
View
2  ...nexus/client/internal/rest/jersey/subsystem/repository/JerseyHostedRepositoryFactory.java
@@ -39,7 +39,7 @@ public int canAdapt( final RepositoryBaseResource resource )
{
score++;
}
- if ( "hosted".equals( resource.getRepoType() ) )
+ if ( JerseyHostedRepository.REPO_TYPE.equals( resource.getRepoType() ) )
{
score++;
}
View
8 ...onatype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepository.java
@@ -27,6 +27,10 @@
implements ProxyRepository<T>
{
+ static final String REPO_TYPE = "proxy";
+
+ static final String PROVIDER_ROLE = "org.sonatype.nexus.proxy.repository.Repository";
+
public JerseyProxyRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -42,8 +46,8 @@ protected RepositoryProxyResource createSettings()
{
final RepositoryProxyResource settings = new RepositoryProxyResource();
- settings.setRepoType( "proxy" );
- settings.setProviderRole( "org.sonatype.nexus.proxy.repository.Repository" );
+ settings.setRepoType( REPO_TYPE );
+ settings.setProviderRole( PROVIDER_ROLE );
settings.setExposed( true );
settings.setWritePolicy( "READ_ONLY" );
settings.setBrowseable( true );
View
2  .../nexus/client/internal/rest/jersey/subsystem/repository/JerseyProxyRepositoryFactory.java
@@ -39,7 +39,7 @@ public int canAdapt( final RepositoryBaseResource resource )
{
score++;
}
- if ( "proxy".equals( resource.getRepoType() ) )
+ if ( JerseyProxyRepository.REPO_TYPE.equals( resource.getRepoType() ) )
{
score++;
}
View
8 ...natype/nexus/client/internal/rest/jersey/subsystem/repository/JerseyShadowRepository.java
@@ -25,6 +25,10 @@
implements ShadowRepository<T>
{
+ static final String REPO_TYPE = "virtual";
+
+ static final String PROVIDER_ROLE = "org.sonatype.nexus.proxy.repository.ShadowRepository";
+
public JerseyShadowRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -40,8 +44,8 @@ protected RepositoryShadowResource createSettings()
{
final RepositoryShadowResource settings = new RepositoryShadowResource();
- settings.setRepoType( "virtual" );
- settings.setProviderRole( "org.sonatype.nexus.proxy.repository.ShadowRepository" );
+ settings.setRepoType( REPO_TYPE );
+ settings.setProviderRole( PROVIDER_ROLE );
settings.setExposed( true );
return settings;
View
2  ...nexus/client/internal/rest/jersey/subsystem/repository/JerseyShadowRepositoryFactory.java
@@ -39,7 +39,7 @@ public int canAdapt( final RepositoryBaseResource resource )
{
score++;
}
- if ( "virtual".equals( resource.getRepoType() ) )
+ if ( JerseyShadowRepository.REPO_TYPE.equals( resource.getRepoType() ) )
{
score++;
}
View
4 ...us/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenGroupRepository.java
@@ -22,6 +22,8 @@
implements MavenGroupRepository
{
+ static final String PROVIDER = "maven2";
+
public JerseyMavenGroupRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -37,7 +39,7 @@ protected RepositoryGroupResource createSettings()
{
final RepositoryGroupResource settings = super.createSettings();
- settings.setProvider( "maven2" );
+ settings.setProvider( PROVIDER );
return settings;
}
View
2  ...nt/internal/rest/jersey/subsystem/repository/maven/JerseyMavenGroupRepositoryFactory.java
@@ -34,7 +34,7 @@ public int canAdapt( final RepositoryBaseResource resource )
int score = super.canAdapt( resource );
if ( score > 0 )
{
- if ( "maven2".equals( resource.getProvider() ) )
+ if ( JerseyMavenGroupRepository.PROVIDER.equals( resource.getProvider() ) )
{
score++;
}
View
4 ...s/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenHostedRepository.java
@@ -22,6 +22,8 @@
implements MavenHostedRepository
{
+ static final String PROVIDER = "maven2";
+
public JerseyMavenHostedRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -37,7 +39,7 @@ protected RepositoryResource createSettings()
{
final RepositoryResource settings = super.createSettings();
- settings.setProvider( "maven2" );
+ settings.setProvider( PROVIDER );
settings.setIndexable( true );
settings.setRepoPolicy( "RELEASE" );
View
2  ...t/internal/rest/jersey/subsystem/repository/maven/JerseyMavenHostedRepositoryFactory.java
@@ -34,7 +34,7 @@ public int canAdapt( final RepositoryBaseResource resource )
int score = super.canAdapt( resource );
if ( score > 0 )
{
- if ( "maven2".equals( resource.getProvider() ) )
+ if ( JerseyMavenHostedRepository.PROVIDER.equals( resource.getProvider() ) )
{
score++;
}
View
4 ...us/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenProxyRepository.java
@@ -22,6 +22,8 @@
implements MavenProxyRepository
{
+ static final String PROVIDER = "maven2";
+
public JerseyMavenProxyRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -37,7 +39,7 @@ protected RepositoryProxyResource createSettings()
{
final RepositoryProxyResource settings = super.createSettings();
- settings.setProvider( "maven2" );
+ settings.setProvider( PROVIDER );
settings.setIndexable( true );
settings.setRepoPolicy( "RELEASE" );
View
2  ...nt/internal/rest/jersey/subsystem/repository/maven/JerseyMavenProxyRepositoryFactory.java
@@ -34,7 +34,7 @@ public int canAdapt( final RepositoryBaseResource resource )
int score = super.canAdapt( resource );
if ( score > 0 )
{
- if ( "maven2".equals( resource.getProvider() ) )
+ if ( JerseyMavenProxyRepository.PROVIDER.equals( resource.getProvider() ) )
{
score++;
}
View
4 ...s/client/internal/rest/jersey/subsystem/repository/maven/JerseyMavenShadowRepository.java
@@ -22,6 +22,8 @@
implements MavenShadowRepository
{
+ static final String PROVIDER = "m2-m1-shadow";
+
public JerseyMavenShadowRepository( final JerseyNexusClient nexusClient, final String id )
{
super( nexusClient, id );
@@ -37,7 +39,7 @@ protected RepositoryShadowResource createSettings()
{
final RepositoryShadowResource settings = super.createSettings();
- settings.setProvider( "m2-m1-shadow" );
+ settings.setProvider( PROVIDER );
return settings;
}
View
2  ...t/internal/rest/jersey/subsystem/repository/maven/JerseyMavenShadowRepositoryFactory.java
@@ -34,7 +34,7 @@ public int canAdapt( final RepositoryBaseResource resource )
int score = super.canAdapt( resource );
if ( score > 0 )
{
- if ( "m2-m1-shadow".equals( resource.getProvider() ) )
+ if ( JerseyMavenShadowRepository.PROVIDER.equals( resource.getProvider() ) )
{
score++;
}
Please sign in to comment.
Something went wrong with that request. Please try again.