code: private static String validLocation(final String loc) throws IOException {
          if (!RsReturn.LOC_PTRN.matcher(loc).matches()) {
              throw new IOException(
                  String.format(
                      "Location \"%s\" should complain RFC 3987",
                      loc
                  )
              );
          }
          return loc;
      }
docs: Checks location according to RFC 3987.
  @param loc Location to be checked
  @return Valid location
  @throws IOException If fails