Class FileSystemOptions
java.lang.Object
io.vertx.core.file.FileSystemOptions
Vert.x file system base configuration, this class can be extended by provider implementations to configure
those specific implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe 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 final booleanThe default value for using file cache dir as exact path =falsestatic final StringThe default file caching dir.static final booleanThe 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
ConstructorsConstructorDescriptionDefault constructorCopy constructorFileSystemOptions(JsonObject json) Creates a new instance ofFileSystemOptionsfrom the JSON object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleansetClassPathResolvingEnabled(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.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.setFileCacheDirAsExactPath(boolean fileCacheDirAsExactPath) Set totrueto use the configured file cache dir as an exact path.setFileCachingEnabled(boolean fileCachingEnabled) Set totrueto cache files on the real file system when the filesystem performs class path resolving.toJson()Builds a JSON object representing the currentFileSystemOptions.toString()
-
Field Details
-
DEFAULT_FILE_CACHING_ENABLED
public static final boolean DEFAULT_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" -
DEFAULT_CLASS_PATH_RESOLVING_ENABLED
public static final boolean DEFAULT_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" -
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. -
DEFAULT_FILE_CACHE_DIR_AS_EXACT_PATH
public static final boolean DEFAULT_FILE_CACHE_DIR_AS_EXACT_PATHThe default value for using file cache dir as exact path =false- See Also:
-
-
Constructor Details
-
FileSystemOptions
public FileSystemOptions()Default constructor -
FileSystemOptions
Copy constructor- Parameters:
other- The otherFileSystemOptionsto copy when creating this
-
FileSystemOptions
Creates a new instance ofFileSystemOptionsfrom the JSON object. This JSOn object has (generally) been generated usingtoJson().- Parameters:
json- the json object
-
-
Method Details
-
toJson
Builds a JSON object representing the currentFileSystemOptions.- Returns:
- the JSON representation
-
isClassPathResolvingEnabled
public boolean isClassPathResolvingEnabled()- Returns:
- whether classpath resolving is enabled
-
setClassPathResolvingEnabled
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
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
- Returns:
- the configured file cache dir
-
setFileCacheDir
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
-
isFileCacheDirAsExactPath
public boolean isFileCacheDirAsExactPath()- Returns:
- whether the file cache dir should be used as an exact path
-
setFileCacheDirAsExactPath
Set totrueto use the configured file cache dir as an exact path. Whenfalse(the default), a unique subdirectory is created under the file cache dir. Whentrueand the directory already exists, a suffix like "-2", "-3", etc. is appended to guarantee uniqueness.- Parameters:
fileCacheDirAsExactPath- the value- Returns:
- a reference to this, so the API can be used fluently
-
toString
-