### Question:
FileTypes implements RegistryListener { public synchronized boolean matchesArtifactPattern( String relativePath ) { relativePath = relativePath.replace( '\\', '/' ); if ( artifactPatterns == null ) { artifactPatterns = getFileTypePatterns( ARTIFACTS ); } for ( String pattern : artifactPatterns ) { 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; }### Answer:
@Test public void testIsArtifact() { assertTrue( filetypes.matchesArtifactPattern( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); assertTrue( filetypes.matchesArtifactPattern( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); assertTrue( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.asc" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/maven-metadata.xml" ) ); }