### Question:
FileResource extends Resource { @Override public boolean exists() { return new File(extractFileNameFromFileResource(path)).exists(); } FileResource(String path); @Override boolean exists(); @Override InputStream getInputStream();  }### Answer:
@Test public void checkThatFileResourceExists() throws Exception { final FileResource nonExisting = new FileResource("devNullFile"); assertFalse(nonExisting.exists()); final File file = new File(getClass().getResource("/cache1.ini").toURI()); assertTrue(file.exists()); final FileResource existing = new FileResource(file.toURI().toString()); assertTrue(existing.exists()); }