Skip to content

Instantly share code, notes, and snippets.

@anuvrat
Created March 4, 2012 12:49
Show Gist options
  • Save anuvrat/1972858 to your computer and use it in GitHub Desktop.
Save anuvrat/1972858 to your computer and use it in GitHub Desktop.
public String cleanUrlNew(String url, String locale, String asin) {
String result;
try {
URL tempUrl = new URL(url);
result = tempUrl.getProtocol() + "://" + tempUrl.getAuthority() + tempUrl.getPath();
} catch (MalformedURLException e) {
// This should never happen. If it happens we should file a bug with PAAPI team.
logger.warn("PAAPI returned an invalid url - " + url);
result = cleanUrl(url, locale, asin);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment