code: public static boolean branchExists(String branch, String baseUrl) {
          CommandLine cmdLine = new CommandLine(SVN_CMD);
          cmdLine.addArgument(CMD_LOG);
          cmdLine.addArgument(OPT_XML);
          addDefaultArguments(cmdLine, null, null);
          cmdLine.addArgument("-r");
          cmdLine.addArgument("HEAD:HEAD");
          cmdLine.addArgument(baseUrl + branch);
  
          try (InputStream inStr = ExecutionHelper.getCommandResult(cmdLine, new File("."), 0, 120000)) {
              return true;
          } catch (IOException e) {
              log.log(Level.FINE, "Branch " + branch + " not found or other error", e);
              return false;
          }
      }
docs: Check if the given branch already exists
  
  @param branch The name of the branch including the path to the branch, e.g. branches/4.2.x
  @param baseUrl       The SVN url to connect to
  @return true if the branch already exists, false otherwise.