code: public static URI createUri(String uriString) throws DataSourceException {
          if(uriString == null) {
              throw new DataSourceResourceException("URI string is null");
          }
  
          try {
              return new URI(uriString);
          } catch(URISyntaxException e) {
              throw new DataSourceResourceException("Not a valid URI: " +
                      uriString, e);
          }
      }
docs: Attempt to construct an instance of URI from the given String.
  
  @param uriString the String representation of the possible URI.
  @throws DataSourceException if the parameter is not a valid URI.