Top Description Methods
io.vertx.core.spi.file

public Interface FileResolver

extends Closeable
Known Direct Implementers
io.vertx.core.file.impl.FileResolverImpl
Imports
java.io.Closeable, .File, .IOException

Sometimes the file resources of an application are bundled into jars, or are somewhere on the classpath but not available on the file system, e.g. in the case of a Vert.x webapp bundled as a fat jar.

In this case we want the application to access the resource from the classpath as if it was on the file system.

We can do this by looking for the file on the classpath, and if found, copying it to a temporary cache directory on disk and serving it from there.

There is one cache dir per Vert.x instance which is deleted on Vert.x shutdown.

Authors
Tim Fox, Rob Worsnop

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.io.Closeable.close.

Close this file resolver, this is a blocking operation.

public File

Returns:

a file resolved
resolveFile
(String
the name to resolve
fileName
)

Resolve the file for the specified fileName.

Method Detail

closeback to summary
public void close() throws IOException

Redeclares java.io.Closeable.close.

Close this file resolver, this is a blocking operation.

Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

resolveFileback to summary
public File resolveFile(String fileName)

Resolve the file for the specified fileName. This method should never return null, it can return a file that does not exist.

Parameters
fileName:String

the name to resolve

Returns:File

a file resolved