@Test public void should_extract_file_name_from_url() throws Exception { final String tomcatUrl = "http: final String expectedFileName = "apache-tomcat-6.0.48"; final String fileName = new FileNameFromUrlExtractor(tomcatUrl).extract(); assertEquals(expectedFileName, fileName); }
public String extract() { final int lastBackslash = url.lastIndexOf('/'); final String fileName = url.substring(lastBackslash + 1); return fileName.substring(0, fileName.lastIndexOf('.')); }
FileNameFromUrlExtractor { public String extract() { final int lastBackslash = url.lastIndexOf('/'); final String fileName = url.substring(lastBackslash + 1); return fileName.substring(0, fileName.lastIndexOf('.')); } }
FileNameFromUrlExtractor { public String extract() { final int lastBackslash = url.lastIndexOf('/'); final String fileName = url.substring(lastBackslash + 1); return fileName.substring(0, fileName.lastIndexOf('.')); } FileNameFromUrlExtractor(String url); }
FileNameFromUrlExtractor { public String extract() { final int lastBackslash = url.lastIndexOf('/'); final String fileName = url.substring(lastBackslash + 1); return fileName.substring(0, fileName.lastIndexOf('.')); } FileNameFromUrlExtractor(String url); String extract(); }
FileNameFromUrlExtractor { public String extract() { final int lastBackslash = url.lastIndexOf('/'); final String fileName = url.substring(lastBackslash + 1); return fileName.substring(0, fileName.lastIndexOf('.')); } FileNameFromUrlExtractor(String url); String extract();  }