WebArchive implements Archive { String getSrcFileName() { String name = src.getName(); if(src.isFile()){ name = name.replaceAll("\\.war$", ""); name = name.replaceAll("\\.zip$", ""); } return name; } WebArchive(File src); ArchiveType getType(); void initialize(); void integrate(); void cleanup();  }
@Test public void testFileName() throws Exception { File f = new File(TestUtil.getWarArchiveDir()+"wars/zipped-0.3-SNAPSHOT.war"); WebArchive arch = new WebArchive(f); assertEquals("zipped-0.3-SNAPSHOT",arch.getSrcFileName()); f = new File(TestUtil.getWarArchiveDir()+"wars/zipped-0.3.war"); arch = new WebArchive(f); assertEquals("zipped-0.3.war",arch.getSrcFileName()); }