@Test public void testDefaultExclusions() { assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.gz" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.zip" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) ); assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) ); assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); }
public boolean matchesDefaultExclusions( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); for ( String pattern : DEFAULT_EXCLUSIONS ) { if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) ) { return true; } } return false; }
FileTypes implements RegistryListener { public boolean matchesDefaultExclusions( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); for ( String pattern : DEFAULT_EXCLUSIONS ) { if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) ) { return true; } } return false; } }
FileTypes implements RegistryListener { public boolean matchesDefaultExclusions( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); for ( String pattern : DEFAULT_EXCLUSIONS ) { if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) ) { return true; } } return false; } FileTypes(); }
FileTypes implements RegistryListener { public boolean matchesDefaultExclusions( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); for ( String pattern : DEFAULT_EXCLUSIONS ) { if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) ) { return true; } } return false; } FileTypes(); void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ); List<String> getFileTypePatterns( String id ); synchronized boolean matchesArtifactPattern( String relativePath ); boolean matchesDefaultExclusions( String relativePath ); @PostConstruct void initialize(); @Override void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ); @Override void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ); }
FileTypes implements RegistryListener { public boolean matchesDefaultExclusions( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); for ( String pattern : DEFAULT_EXCLUSIONS ) { if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) ) { return true; } } return false; } FileTypes(); void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ); List<String> getFileTypePatterns( String id ); synchronized boolean matchesArtifactPattern( String relativePath ); boolean matchesDefaultExclusions( String relativePath ); @PostConstruct void initialize(); @Override void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ); @Override void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ); static final String ARTIFACTS; static final String AUTO_REMOVE; static final String INDEXABLE_CONTENT; static final String IGNORED; static final List<String> DEFAULT_EXCLUSIONS; }