package Visual_DVM_2021.Passes.All; import Common.Utils.Utils; import Visual_DVM_2021.Passes.PassException; import Visual_DVM_2021.Passes.SSH.CurrentConnectionPass; public class TestPass extends CurrentConnectionPass { @Override protected void ServerAction() throws Exception { String dir = "/home/testuser/jack sparrow/"; String command = "rm -rf " + Utils.DQuotes(dir); if (!dir.isEmpty() && !dir.equals("/") && !dir.equals("\\") && !dir.equals("*")) { user.connection.Command(command); } else throw new PassException("Недопустимый путь для удаления папки " + Utils.DQuotes(dir)); } }