@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class WorkDirManager extends Object
WorkDirManager.DirType.| Modifier and Type | Class and Description |
|---|---|
static class |
WorkDirManager.DirType
Defines components of the Working directory.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_FAIL_IF_WORKDIR_IS_MISSING
Default value for the behavior when the requested working directory is missing.
|
static String |
JUL_CONFIG_FILE_SYSTEM_PROPERTY_NAME
Name of the standard System Property, which points to the
java.util.logging config file. |
static String |
SUPPORTED_INTERNAL_DIR_NAME_MASK
Regular expression, which declares restrictions of the remoting internal directory symbols
|
| Modifier and Type | Method and Description |
|---|---|
void |
disable(WorkDirManager.DirType dir) |
static WorkDirManager |
getInstance()
Retrieves the instance of the
WorkDirManager. |
File |
getLocation(WorkDirManager.DirType type) |
Path |
getLocationPath(WorkDirManager.DirType type)
Get
Path of the directory. |
File |
getLoggingConfigFile()
Gets path to the property file with JUL settings.
|
Path |
initializeWorkDir(File workDir,
String internalDir,
boolean failIfMissing)
Initializes the working directory for the agent.
|
void |
setLoggingConfig(File configFile)
Sets path to the Logging JUL property file with logging settings.
|
void |
setupLogging(Path internalDirPath,
Path overrideLogPath)
Sets up logging subsystem in the working directory.
|
public static final boolean DEFAULT_FAIL_IF_WORKDIR_IS_MISSING
false, because otherwise agents would fail on the first startup.public static final String SUPPORTED_INTERNAL_DIR_NAME_MASK
public static final String JUL_CONFIG_FILE_SYSTEM_PROPERTY_NAME
java.util.logging config file.@Nonnull public static WorkDirManager getInstance()
WorkDirManager.
Currently the implementation is hardcoded, but it may change in the future.public void disable(@Nonnull WorkDirManager.DirType dir)
@CheckForNull public File getLocation(@Nonnull WorkDirManager.DirType type)
@CheckForNull public Path getLocationPath(@Nonnull WorkDirManager.DirType type) throws IOException
Path of the directory.type - Type of the directoryIOException - Invalid path, e.g. ig the root directory is incorrectpublic void setLoggingConfig(@Nonnull File configFile)
configFile - config file@CheckForNull public File getLoggingConfigFile()
setLoggingConfig(java.io.File) first.
If the value is not specified, it also checks the standard java.util.logging.config.file System property.null if it cannot be found.@CheckForNull public Path initializeWorkDir(@CheckForNull File workDir, @Nonnull String internalDir, boolean failIfMissing) throws IOException
workDir - Working directoryinternalDir - Name of the remoting internal data directory within the working directory.
The range of the supported symbols is restricted to SUPPORTED_INTERNAL_DIR_NAME_MASK.failIfMissing - Fail the initialization if the workDir or internalDir are missing.
This option presumes that the workspace structure gets initialized previously in order to ensure that we do not start up with a borked instance
(e.g. if a mount gets disconnected).null if it is disabledIOException - Workspace allocation issue (e.g. the specified directory is not writable).
In such case Remoting should not start up at all.public void setupLogging(@CheckForNull Path internalDirPath, @CheckForNull Path overrideLogPath) throws IOException
internalDirPath - Path to the internal remoting directory within the WorkDir.
If this value and overrideLogPath are null, the logging subsystem woill not
be initialized at alloverrideLogPath - Overrides the common location of the remoting log.
If specified, logging system will be initialized in the legacy way.
If null, the behavior is defined by internalDirPath.IOException - Initialization errorCopyright © 2004–2020. All rights reserved.