@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class WindowsUtil extends Object
Constructor and Description |
---|
WindowsUtil() |
Modifier and Type | Method and Description |
---|---|
static File |
createJunction(File junction,
File target)
Creates an NTFS junction point if supported.
|
static Process |
execCmd(String... argv)
Executes a command and arguments using
cmd.exe /C ... . |
static String |
quoteArgument(String argument)
Quotes an argument while escaping special characters interpreted by CreateProcess.
|
static String |
quoteArgumentForCmd(String argument)
Quotes an argument while escaping special characters suitable for use as an argument to
cmd.exe . |
@Nonnull public static String quoteArgument(@Nonnull String argument)
@Nonnull public static String quoteArgumentForCmd(@Nonnull String argument)
cmd.exe
.@Nonnull public static Process execCmd(String... argv) throws IOException
cmd.exe /C ...
.IOException
@Nonnull public static File createJunction(@Nonnull File junction, @Nonnull File target) throws IOException, InterruptedException
junction
- NTFS junction point to createtarget
- target directory to junctionIOException
- if the call to mklink exits with a non-zero status codeInterruptedException
- if the call to mklink is interrupted before completingUnsupportedOperationException
- if this method is called on a non-Windows platformCopyright © 2016–2020. All rights reserved.