/** * Method addRepository. * * @param string */ public void addRepository( String string ) { getRepositories().add( string ); } //-- void addRepository( String )
/** * Method removeRepository. * * @param string */ public void removeRepository( String string ) { getRepositories().remove( string ); } //-- void removeRepository( String )
protected RepositoryPathMapping convert( CPathMappingItem item ) throws IllegalArgumentException { MappingType type = null; if ( CPathMappingItem.BLOCKING_RULE_TYPE.equals( item.getRouteType() ) ) { type = MappingType.BLOCKING; } else if ( CPathMappingItem.INCLUSION_RULE_TYPE.equals( item.getRouteType() ) ) { type = MappingType.INCLUSION; } else if ( CPathMappingItem.EXCLUSION_RULE_TYPE.equals( item.getRouteType() ) ) { type = MappingType.EXCLUSION; } else { logger.warn( "Unknown route type: " + item.getRouteType() ); throw new IllegalArgumentException( "Unknown route type: " + item.getRouteType() ); } return new RepositoryPathMapping( item.getId(), type, item.getGroupId(), item.getRoutePatterns(), item.getRepositories() ); }
public void validateRoutesConfig(RepositoryRouteResource resource) throws IOException { CPathMappingItem cRoute = getTest().getNexusConfigUtil().getRoute(resource.getId()); String msg = "Should be the same route. \n Expected:\n" + new XStream().toXML(resource) + " \n \n Got: \n" + new XStream().toXML(cRoute); Assert.assertEquals(msg, cRoute.getId(), resource.getId()); Assert.assertEquals(msg, cRoute.getGroupId(), resource.getGroupId()); Assert.assertEquals(msg, cRoute.getRoutePatterns(), Collections.singletonList(resource.getPattern())); Assert.assertEquals(msg, cRoute.getRouteType(), resource.getRuleType()); this.validateSameRepoIds(resource.getRepositories(), cRoute.getRepositories()); }
if ( ( cPathMappingItem.getRepositories() != null ) && ( cPathMappingItem.getRepositories().size() > 0 ) ) for ( Iterator iter = cPathMappingItem.getRepositories().iterator(); iter.hasNext(); )
for ( String repoId : (List<String>) item.getRepositories() )
for ( String repoId : item.getRepositories() )