Class ServerRoot
java.lang.Object
com.ultikits.ultitools.utils.ServerRoot
Resolves the framework's server root. Without a test boot override, each consumer keeps its
original source: either the JVM working-directory property or the plugin data folder's
grandparent. They need not match, so neither is a fallback for the other.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classLifetime of one in-process test server root. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable FileforDataFolder(File dataFolder) Uses the same lexical parent lookup as the credential store.static ServerRoot.TestScopeoverrideForTestBoot(File root) Installs a root for the in-process test boot entry only.static File
-
Field Details
-
TEST_SCOPE
-
-
Constructor Details
-
ServerRoot
private ServerRoot()
-
-
Method Details
-
workingDirectory
- Returns:
- the test root, or the same working-directory file used by the panel on Paper
-
forDataFolder
Uses the same lexical parent lookup as the credential store. Callers which used to make the data folder absolute first (module file transactions) must continue to do so themselves.- Parameters:
dataFolder- the plugin's data folder- Returns:
- the test root or the given folder's grandparent, without normalizing the path
-
overrideForTestBoot
Installs a root for the in-process test boot entry only. Acquire the scope before bootstrap prepares module transactions; hold it until the plugin and its background work have shut down. Close it on failed boot as well, after any partial-start cleanup. The override is visible to framework worker threads and is not a server setting or a module API.- Parameters:
root- the isolated test server directory (distinct from the plugin's data folder)- Returns:
- the handle that owns this override
- Throws:
IllegalArgumentException- if the root is relativeIllegalStateException- if another test boot already holds the override
-