static public SshExec sshExec(SshSession session) { return new JschExec(Contexts.currentContext(), session); }
static public Pipeline pipeline() { return new Pipeline(Contexts.currentContext()); }
static public SshSftp sshSftp(SshSession session) { return new JschSftp(Contexts.currentContext(), session); }
static public Pipeline pipeline() { return new Pipeline(Contexts.currentContext()); }
static public Tail tail(int count) { return new Tail(Contexts.currentContext()) .count(count); }
static public Head head(int count) { return new Head(Contexts.currentContext()) .count(count); }
static public Head head(int count) { return new Head(Contexts.currentContext()) .count(count); }
static public Tail tail(int count) { return new Tail(Contexts.currentContext()) .count(count); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(Path command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(File command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(String command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to find `which` executable to use for a command. Similar to a Unix `which` * command. Platform-specific executable extensions do not need to included * (e.g. `.bat` on windows). Will search for an executable base do on * the environment PATH variable as well as any user-defined paths. * * <pre> * import static com.fizzed.blaze.Systems.which; * * // ... * * Path p = which("javac").run(); * </pre> * * @param command The command to search for such as "javac" or "ls" * @return A new Which action bound to current context */ static public Which which(File command) { return new Which(Contexts.currentContext()) .command(command); }
/** * Prepares an action to find `which` executable to use for a command. Similiar to a Unix `which` * command. Platform-specific executable extensions do not need to included * (e.g. `.bat` on windows). Will search for an executable base do on * the environment PATH variable as well as any user-defined paths. * * <pre> * import static com.fizzed.blaze.Systems.which; * * // ... * * Path p = which("javac").run(); * </pre> * * @param command The command to search for such as "javac" or "ls" * @return A new Which action bound to current context */ static public Which which(String command) { return new Which(Contexts.currentContext()) .command(command); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(File command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(Path command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(String command) { return new RequireExec(Contexts.currentContext()) .command(command); }
/** * Prepares an action to delete one or more files and directories. * * <pre> * import static com.fizzed.blaze.Systems.remove; * * // ... * * remove(Paths.get("images")) * .recursive() * .force() * .run(); * </pre> * * @param paths The paths to delete * @return A new Remove action bound to current context */ static public Remove remove(Path... paths) { return new Remove(Contexts.currentContext()) .paths(paths); }
static public SshExec sshExec(SshSession session, String command, Object ... arguments) { return new JschExec(Contexts.currentContext(), session) .command(command) .args(arguments); }
static public SshConnect sshConnect(MutableUri uri) { // load provider SshProvider provider = SchemeProvider.load(uri.getScheme(), SshProvider.class); return provider.connect(Contexts.currentContext(), uri); }
/** * Prepares an action to require an executable to be present or an exception will be thrown and * the script will stop executing. Will use which() under-the-hood. * * <pre> * import static com.fizzed.blaze.Systems.requireExec; * * // ... * * requireExec("javac", "Java is used for compiling stuff.").run(); * </pre> * * @param command The command to require for such as "javac" or "ls" * @param message The custom message to display * @return A new RequireExec action bound to current context */ static public RequireExec requireExec(File command, String message) { return new RequireExec(Contexts.currentContext()) .command(command) .message(message); }