/** * Method removeRoutePattern. * * @param string */ public void removeRoutePattern( String string ) { getRoutePatterns().remove( string ); } //-- void removeRoutePattern( String )
/** * Method addRoutePattern. * * @param string */ public void addRoutePattern( String string ) { getRoutePatterns().add( string ); } //-- void addRoutePattern( 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.getRoutePatterns() != null ) && ( cPathMappingItem.getRoutePatterns().size() > 0 ) ) for ( Iterator iter = cPathMappingItem.getRoutePatterns().iterator(); iter.hasNext(); )
if (item.getRoutePatterns() == null || item.getRoutePatterns().isEmpty()) for ( String regexp : item.getRoutePatterns() )
if ( item.getRoutePatterns() == null || item.getRoutePatterns().isEmpty() ) for ( String regexp : (List<String>) item.getRoutePatterns() )