Package io.vertx.core.file
Class FileSystemOptions
- java.lang.Object
-
- io.vertx.core.file.FileSystemOptions
-
public class FileSystemOptions extends Object
Vert.x file system base configuration, this class can be extended by provider implementations to configure those specific implementations.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_CLASS_PATH_RESOLVING_ENABLEDThe default behavior to cache or not class path resolution =falseif and only if the system property"vertx.disableFileCPResolving"exists and is set to the string"false"static StringDEFAULT_FILE_CACHING_DIRThe default file caching dir.static booleanDEFAULT_FILE_CACHING_ENABLEDThe default behavior for caching files for class path resolution =falseif and only if the system property"vertx.disableFileCaching"exists and is set to the string"false"
-
Constructor Summary
Constructors Constructor Description FileSystemOptions()Default constructorFileSystemOptions(FileSystemOptions other)Copy constructorFileSystemOptions(JsonObject json)Creates a new instance ofFileSystemOptionsfrom the JSON object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFileCacheDir()booleanisClassPathResolvingEnabled()booleanisFileCachingEnabled()FileSystemOptionssetClassPathResolvingEnabled(boolean classPathResolvingEnabled)When vert.x cannot find the file on the filesystem it tries to resolve the file from the class path when this is set totrue.FileSystemOptionssetFileCacheDir(String fileCacheDir)When vert.x reads a file that is packaged with the application it gets extracted to this directory first and subsequent reads will use the extracted file to get better IO performance.FileSystemOptionssetFileCachingEnabled(boolean fileCachingEnabled)Set totrueto cache files on the real file system when the filesystem performs class path resolving.JsonObjecttoJson()Builds a JSON object representing the currentFileSystemOptions.StringtoString()
-
-
-
Field Detail
-
DEFAULT_FILE_CACHING_ENABLED
public static final boolean DEFAULT_FILE_CACHING_ENABLED
The default behavior for caching files for class path resolution =falseif and only if the system property"vertx.disableFileCaching"exists and is set to the string"false"
-
DEFAULT_CLASS_PATH_RESOLVING_ENABLED
public static final boolean DEFAULT_CLASS_PATH_RESOLVING_ENABLED
The default behavior to cache or not class path resolution =falseif and only if the system property"vertx.disableFileCPResolving"exists and is set to the string"false"
-
DEFAULT_FILE_CACHING_DIR
public static final String DEFAULT_FILE_CACHING_DIR
The default file caching dir. If the system property"vertx.cacheDirBase"is set, then this is the value If not, then the system propertyjava.io.tmpdiris taken or {code .} if not set. suffixed withvertx-cache.
-
-
Constructor Detail
-
FileSystemOptions
public FileSystemOptions()
Default constructor
-
FileSystemOptions
public FileSystemOptions(FileSystemOptions other)
Copy constructor- Parameters:
other- The otherFileSystemOptionsto copy when creating this
-
FileSystemOptions
public FileSystemOptions(JsonObject json)
Creates a new instance ofFileSystemOptionsfrom the JSON object. This JSOn object has (generally) been generated usingtoJson().- Parameters:
json- the json object
-
-
Method Detail
-
toJson
public JsonObject toJson()
Builds a JSON object representing the currentFileSystemOptions.- Returns:
- the JSON representation
-
isClassPathResolvingEnabled
public boolean isClassPathResolvingEnabled()
- Returns:
- whether classpath resolving is enabled
-
setClassPathResolvingEnabled
public FileSystemOptions setClassPathResolvingEnabled(boolean classPathResolvingEnabled)
When vert.x cannot find the file on the filesystem it tries to resolve the file from the class path when this is set totrue.- Parameters:
classPathResolvingEnabled- the value- Returns:
- a reference to this, so the API can be used fluently
-
isFileCachingEnabled
public boolean isFileCachingEnabled()
- Returns:
- whether file caching is enabled for class path resolving
-
setFileCachingEnabled
public FileSystemOptions setFileCachingEnabled(boolean fileCachingEnabled)
Set totrueto cache files on the real file system when the filesystem performs class path resolving.- Parameters:
fileCachingEnabled- the value- Returns:
- a reference to this, so the API can be used fluently
-
getFileCacheDir
public String getFileCacheDir()
- Returns:
- the configured file cache dir
-
setFileCacheDir
public FileSystemOptions setFileCacheDir(String fileCacheDir)
When vert.x reads a file that is packaged with the application it gets extracted to this directory first and subsequent reads will use the extracted file to get better IO performance.- Parameters:
fileCacheDir- the value- Returns:
- a reference to this, so the API can be used fluently
-
-