Class DirectoryYamlDriver
java.lang.Object
com.sk89q.worldguard.protection.managers.storage.file.DirectoryYamlDriver
- All Implemented Interfaces:
RegionDriver
Stores region data in a {root_dir}/{id}/{filename} pattern on disk
using
YamlRegionFile
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a region database for a world.getAll()
Fetch all the region databases that have been stored using this driver.
-
Constructor Details
-
DirectoryYamlDriver
Create a new instance.- Parameters:
rootDir
- the directory where the world folders residefilename
- the filename (i.e. "regions.yml")
-
-
Method Details
-
get
Description copied from interface:RegionDriver
Get a region database for a world.The given name should be a unique name for the world. Due to legacy reasons, there are no stipulations on the case sensitivity of the name. Historically, however, if the driver is a file-based driver, case-sensitivity will vary on whether the underlying filesystem is case-sensitive.
This method should return quickly.
- Specified by:
get
in interfaceRegionDriver
- Parameters:
id
- the name of the world, which may be case sensitive- Returns:
- the world
-
getAll
Description copied from interface:RegionDriver
Fetch all the region databases that have been stored using this driver. Essentially, return a region database for all worlds that have had regions saved for it in the past.As this may require a query to be performed, this method may block for a prolonged period of time.
- Specified by:
getAll
in interfaceRegionDriver
- Returns:
- a list of databases
- Throws:
StorageException
- thrown if the fetch operation fails
-