Package jetbrains.buildServer.serverSide
Class IOGuard
- java.lang.Object
-
- jetbrains.buildServer.serverSide.IOGuard
-
public final class IOGuard extends Object
Allows to perform "unsafe" IO operations on read-only node.
The one who uses the class should be sure that the use of restricted operations is safe.- Since:
- 2020.1
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends Exception>
voidallowCommandLine(ActionThrow<E> action)
Code that wants to run command line process should be wrapped to this method.static <R,E extends Exception>
RallowCommandLine(FuncThrow<R,E> function)
Code that wants to run command line process should be wrapped to this method.static <E extends Exception>
voidallowDiskWrite(ActionThrow<E> action)
Code that wants to execute file write operation should be wrapped to this method.static <R,E extends Exception>
RallowDiskWrite(FuncThrow<R,E> function)
Code that wants to execute file write operation should be wrapped to this method.static <E extends Exception>
voidallowNetworkAndCommandLine(ActionThrow<E> action)
Code that wants to run both network call and command line process should be wrapped to this method.static <R,E extends Exception>
RallowNetworkAndCommandLine(FuncThrow<R,E> function)
Code that wants to run both network call and command line process should be wrapped to this method.static <E extends Exception>
voidallowNetworkCall(ActionThrow<E> action)
Code that wants to call network operation should be wrapped to this method.static <R,E extends Exception>
RallowNetworkCall(FuncThrow<R,E> function)
Code that wants to call network operation should be wrapped to this method.
-
-
-
Method Detail
-
allowDiskWrite
public static <E extends Exception> void allowDiskWrite(@NotNull ActionThrow<E> action) throws E extends Exception
Code that wants to execute file write operation should be wrapped to this method.- Type Parameters:
E
- type of exception that the action could throw- Parameters:
action
- action to execute- Throws:
E
- exception if the action throws an exceptionE extends Exception
-
allowDiskWrite
public static <R,E extends Exception> R allowDiskWrite(@NotNull FuncThrow<R,E> function) throws E extends Exception
Code that wants to execute file write operation should be wrapped to this method.- Type Parameters:
R
- type of the function resultE
- type of exception that the function could throw- Parameters:
function
- function to execute- Returns:
- function result
- Throws:
E
- exception if the function throws an exceptionE extends Exception
-
allowNetworkCall
public static <E extends Exception> void allowNetworkCall(@NotNull ActionThrow<E> action) throws E extends Exception
Code that wants to call network operation should be wrapped to this method.- Type Parameters:
E
- type of exception that the action could throw- Parameters:
action
- action to execute- Throws:
E
- exception if the action throws an exceptionE extends Exception
-
allowNetworkCall
public static <R,E extends Exception> R allowNetworkCall(@NotNull FuncThrow<R,E> function) throws E extends Exception
Code that wants to call network operation should be wrapped to this method.- Type Parameters:
R
- type of the function resultE
- type of exception that the function could throw- Parameters:
function
- function to execute- Returns:
- function result
- Throws:
E
- exception if the function throws an exceptionE extends Exception
-
allowCommandLine
public static <E extends Exception> void allowCommandLine(@NotNull ActionThrow<E> action) throws E extends Exception
Code that wants to run command line process should be wrapped to this method.- Type Parameters:
E
- type of exception that the action could throw- Parameters:
action
- action to execute- Throws:
E
- exception if the action throws an exceptionE extends Exception
-
allowCommandLine
public static <R,E extends Exception> R allowCommandLine(@NotNull FuncThrow<R,E> function) throws E extends Exception
Code that wants to run command line process should be wrapped to this method.- Type Parameters:
R
- type of the function resultE
- type of exception that the function could throw- Parameters:
function
- function to execute- Returns:
- function result
- Throws:
E
- exception if the function throws an exceptionE extends Exception
-
allowNetworkAndCommandLine
public static <E extends Exception> void allowNetworkAndCommandLine(@NotNull ActionThrow<E> action) throws E extends Exception
Code that wants to run both network call and command line process should be wrapped to this method.- Type Parameters:
E
- type of exception that the action could throw- Parameters:
action
- action to execute- Throws:
E
- exception if the action throws an exceptionE extends Exception
-
allowNetworkAndCommandLine
public static <R,E extends Exception> R allowNetworkAndCommandLine(@NotNull FuncThrow<R,E> function) throws E extends Exception
Code that wants to run both network call and command line process should be wrapped to this method.- Type Parameters:
R
- type of the function resultE
- type of exception that the function could throw- Parameters:
function
- function to execute- Returns:
- function result
- Throws:
E
- exception if the function throws an exceptionE extends Exception
-
-