use of io.vertx.core.spi.file.FileResolver in project vert.x by eclipse.
the class FileResolverTestBase method testResolveAfterCloseThrowsISE.
@Test
public void testResolveAfterCloseThrowsISE() throws Exception {
FileResolver resolver2 = new FileResolverImpl();
File file = resolver2.resolveFile("webroot/somefile.html");
assertTrue(file.exists());
File cacheDir = file.getParentFile().getParentFile();
assertTrue(cacheDir.exists());
resolver2.close();
assertFalse(cacheDir.exists());
try {
resolver2.resolveFile("webroot/somefile.html");
fail("Should fail");
} catch (IllegalStateException e) {
// OK
}
}
use of io.vertx.core.spi.file.FileResolver in project vert.x by eclipse.
the class FileResolverFactoryTest method testResolver.
@Test
public void testResolver() {
FileResolver resolver = ((VertxInternal) vertx).fileResolver();
assertEquals(CustomFileResolver.class, resolver.getClass());
}
use of io.vertx.core.spi.file.FileResolver in project vert.x by eclipse.
the class FileResolverFactory method init.
@Override
default void init(VertxBuilder builder) {
if (builder.fileResolver() == null) {
FileResolver fileResolver = resolver(builder.options());
builder.fileResolver(fileResolver);
}
}
use of io.vertx.core.spi.file.FileResolver in project vert.x by eclipse.
the class FileResolverTestBase method testDeleteCacheDir.
@Test
public void testDeleteCacheDir() throws Exception {
FileResolver resolver2 = new FileResolverImpl();
File file = resolver2.resolveFile("webroot/somefile.html");
assertTrue(file.exists());
File cacheDir = file.getParentFile().getParentFile();
assertTrue(cacheDir.exists());
resolver2.close();
assertFalse(cacheDir.exists());
}
Aggregations