Skip to content

Commit

Permalink
Add missing uri method
Browse files Browse the repository at this point in the history
  • Loading branch information
dilanSachi committed Jun 13, 2023
1 parent cfa726c commit 7c76a9a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -108,6 +109,16 @@ private static void setInboundReqProperties(HttpCarbonMessage inboundReqMsg, Str
inboundReqMsg.setProperty(HttpConstants.RAW_QUERY_STR, rawQuery);
}

public static URI getValidatedURI(String uriStr) {
URI requestUri;
try {
requestUri = URI.create(uriStr);
} catch (IllegalArgumentException e) {
throw new BallerinaConnectorException(e.getMessage());
}
return requestUri;
}

/**
* This method finds the matching resource for the incoming request.
*
Expand Down

0 comments on commit 7c76a9a

Please sign in to comment.