public final class IOGuard
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <E extends java.lang.Exception> |
allowCommandLine(ActionThrow<E> action)
Code that wants to run command line process should be wrapped to this method.
|
static <R,E extends java.lang.Exception> |
allowCommandLine(FuncThrow<R,E> function)
Code that wants to run command line process should be wrapped to this method.
|
static <E extends java.lang.Exception> |
allowDiskWrite(ActionThrow<E> action)
Code that wants to execute file write operation should be wrapped to this method.
|
static <R,E extends java.lang.Exception> |
allowDiskWrite(FuncThrow<R,E> function)
Code that wants to execute file write operation should be wrapped to this method.
|
static <E extends java.lang.Exception> |
allowNetworkAndCommandLine(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 java.lang.Exception> |
allowNetworkAndCommandLine(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 java.lang.Exception> |
allowNetworkCall(ActionThrow<E> action)
Code that wants to call network operation should be wrapped to this method.
|
static <R,E extends java.lang.Exception> |
allowNetworkCall(FuncThrow<R,E> function)
Code that wants to call network operation should be wrapped to this method.
|
public static <E extends java.lang.Exception> void allowDiskWrite(@NotNull ActionThrow<E> action) throws E extends java.lang.Exception
E
- type of exception that the action could throwaction
- action to executeE
- exception if the action throws an exceptionE extends java.lang.Exception
public static <R,E extends java.lang.Exception> R allowDiskWrite(@NotNull FuncThrow<R,E> function) throws E extends java.lang.Exception
R
- type of the function resultE
- type of exception that the function could throwfunction
- function to executeE
- exception if the function throws an exceptionE extends java.lang.Exception
public static <E extends java.lang.Exception> void allowNetworkCall(@NotNull ActionThrow<E> action) throws E extends java.lang.Exception
E
- type of exception that the action could throwaction
- action to executeE
- exception if the action throws an exceptionE extends java.lang.Exception
public static <R,E extends java.lang.Exception> R allowNetworkCall(@NotNull FuncThrow<R,E> function) throws E extends java.lang.Exception
R
- type of the function resultE
- type of exception that the function could throwfunction
- function to executeE
- exception if the function throws an exceptionE extends java.lang.Exception
public static <E extends java.lang.Exception> void allowCommandLine(@NotNull ActionThrow<E> action) throws E extends java.lang.Exception
E
- type of exception that the action could throwaction
- action to executeE
- exception if the action throws an exceptionE extends java.lang.Exception
public static <R,E extends java.lang.Exception> R allowCommandLine(@NotNull FuncThrow<R,E> function) throws E extends java.lang.Exception
R
- type of the function resultE
- type of exception that the function could throwfunction
- function to executeE
- exception if the function throws an exceptionE extends java.lang.Exception
public static <E extends java.lang.Exception> void allowNetworkAndCommandLine(@NotNull ActionThrow<E> action) throws E extends java.lang.Exception
E
- type of exception that the action could throwaction
- action to executeE
- exception if the action throws an exceptionE extends java.lang.Exception
public static <R,E extends java.lang.Exception> R allowNetworkAndCommandLine(@NotNull FuncThrow<R,E> function) throws E extends java.lang.Exception
R
- type of the function resultE
- type of exception that the function could throwfunction
- function to executeE
- exception if the function throws an exceptionE extends java.lang.Exception