public static Archive forName(final String name) {
        if(StringUtils.isNotBlank(name)) {
            for(Archive archive : getKnownArchives()) {
                for(String extension : archive.getExtensions()) {
                    if(name.toLowerCase(Locale.ROOT).endsWith(extension.toLowerCase(Locale.ROOT))) {
                        return archive;
                    }
                }
            }
        }
        log.fatal(String.format("Unknown archive %s", name));
        return null;
    }
@Test
    public void testForName() {
        assertEquals(Archive.TAR, Archive.forName("tar"));
        assertEquals(Archive.TARGZ, Archive.forName("tar.gz"));
        assertEquals(Archive.ZIP, Archive.forName("zip"));
    }