/** * @param baseURL an base URL for relative URLs */ public void setBaseUrl(String baseURL) { try { baseUrl = UsableURIFactory.getInstance(baseURL); } catch (URIException ex) { // XXX ex.printStackTrace(); } }
public SWFUrlRewriter(ResultURIConverter converter, URL baseUrl, String datespec) { this.datespec = datespec; this.converter = converter; try { this.baseUrl = UsableURIFactory .getInstance(baseUrl.toExternalForm()); } catch (URIException e) { e.printStackTrace(); } }
/** * @param baseURL an base URL for relative URLs */ public void setBaseUrl(String baseURL) { try { baseUrl = UsableURIFactory.getInstance(baseURL); } catch (URIException ex) { // XXX ex.printStackTrace(); } }
public SWFUrlRewriter(ResultURIConverter converter, URL baseUrl, String datespec) { this.datespec = datespec; this.converter = converter; try { this.baseUrl = UsableURIFactory .getInstance(baseUrl.toExternalForm()); } catch (URIException e) { e.printStackTrace(); } }
if(url.startsWith(scheme)) { try { return UsableURIFactory.getInstance(url).getEscapedURI(); } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url); UsableURI resolvedURI = null; try { absBaseURI = UsableURIFactory.getInstance(baseUrl); resolvedURI = UsableURIFactory.getInstance(absBaseURI, url); } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url);
url = UsableURIFactory.getInstance(baseUrl, url).toString() + frag; } catch (URIException e) { LOGGER.warning("FAILED RESOLVE: base(" + baseUrl + ") frag(" + url +
url = UsableURIFactory.getInstance(baseUrl, url).toString() + frag; } catch (URIException e) { LOGGER.warning("FAILED RESOLVE: base(" + baseUrl + ") frag(" + url +
if(url.startsWith(scheme)) { try { return UsableURIFactory.getInstance(url).getEscapedURI(); } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url); UsableURI resolvedURI = null; try { absBaseURI = UsableURIFactory.getInstance(baseUrl); resolvedURI = UsableURIFactory.getInstance(absBaseURI, url); } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url);
private static String getKey(String url, boolean prefix) throws URIException { String key = addImpliedHttpIfNecessary(url); UsableURI uuri = UsableURIFactory.getInstance(key); key = uuri.getScheme() + "://" + uuri.getAuthority() + uuri.getEscapedPathQuery(); key = SURT.fromURI(key); int hashPos = key.indexOf('#'); if(hashPos != -1) { key = key.substring(0,hashPos); } if(key.startsWith("http://")) { key = key.substring(7); } if(prefix) { if(key.endsWith(",)/")) { key = key.substring(0,key.length()-3); } } return key; } }
private static String getKey(String url, boolean prefix) throws URIException { String key = addImpliedHttpIfNecessary(url); UsableURI uuri = UsableURIFactory.getInstance(key); key = uuri.getScheme() + "://" + uuri.getAuthority() + uuri.getEscapedPathQuery(); key = SURT.fromURI(key); int hashPos = key.indexOf('#'); if(hashPos != -1) { key = key.substring(0,hashPos); } if(key.startsWith("http://")) { key = key.substring(7); } if(prefix) { if(key.endsWith(",)/")) { key = key.substring(0,key.length()-3); } } return key; } }
private static String getKey(String url, boolean prefix) throws URIException { String key = ArchiveUtils.addImpliedHttpIfNecessary(url); UsableURI uuri = UsableURIFactory.getInstance(key); key = uuri.getScheme() + "://" + uuri.getAuthority() + uuri.getEscapedPathQuery(); key = SURT.fromURI(key); int hashPos = key.indexOf('#'); if(hashPos != -1) { key = key.substring(0,hashPos); } if(key.startsWith("http://")) { key = key.substring(7); } if(prefix) { if(key.endsWith(",)/")) { key = key.substring(0,key.length()-3); } } return key; } }
private static String getKey(String url, boolean prefix) throws URIException { String key = addImpliedHttpIfNecessary(url); UsableURI uuri = UsableURIFactory.getInstance(key); key = uuri.getScheme() + "://" + uuri.getAuthority() + uuri.getEscapedPathQuery(); key = SURT.fromURI(key); int hashPos = key.indexOf('#'); if(hashPos != -1) { key = key.substring(0,hashPos); } if(key.startsWith("http://")) { key = key.substring(7); } if(prefix) { if(key.endsWith(",)/")) { key = key.substring(0,key.length()-3); } } return key; } }
private static String getKey(String url, boolean prefix) throws URIException { String key = ArchiveUtils.addImpliedHttpIfNecessary(url); UsableURI uuri = UsableURIFactory.getInstance(key); key = uuri.getScheme() + "://" + uuri.getAuthority() + uuri.getEscapedPathQuery(); key = SURT.fromURI(key); int hashPos = key.indexOf('#'); if(hashPos != -1) { key = key.substring(0,hashPos); } if(key.startsWith("http://")) { key = key.substring(7); } if(prefix) { if(key.endsWith(",)/")) { key = key.substring(0,key.length()-3); } } return key; } }
public String rewrite(String url) { try { String resolved = url; if (baseUrl != null) { resolved = UsableURIFactory.getInstance(baseUrl, url).toString(); } return converter.makeReplayURI(datespec, resolved); } catch (URIException e) { e.printStackTrace(); } return url; } }
/** * Find and return the parent directory of the URL argument * @param url to find the parent directory of * @return parent directory of URL, or null, if either the url argument is * invalid, or if the url is the root of the authority. */ public static String getUrlParentDir(String url) { try { UsableURI uri = UsableURIFactory.getInstance(url); String path = uri.getPath(); if(path.length() > 1) { int startIdx = path.length()-1; if(path.charAt(path.length()-1) == '/') { startIdx--; } int idx = path.lastIndexOf('/',startIdx); if(idx >= 0) { uri.setPath(path.substring(0,idx+1)); uri.setQuery(null); return uri.toUnicodeHostString(); } } } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url); } return null; }
/** * Find and return the parent directory of the URL argument * @param url to find the parent directory of * @return parent directory of URL, or null, if either the url argument is * invalid, or if the url is the root of the authority. */ public static String getUrlParentDir(String url) { try { UsableURI uri = UsableURIFactory.getInstance(url); String path = uri.getPath(); if(path.length() > 1) { int startIdx = path.length()-1; if(path.charAt(path.length()-1) == '/') { startIdx--; } int idx = path.lastIndexOf('/',startIdx); if(idx >= 0) { uri.setPath(path.substring(0,idx+1)); uri.setQuery(null); return uri.toUnicodeHostString(); } } } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + url); } return null; }
public String rewrite(String url) { try { String resolved = url; if (baseUrl != null) { resolved = UsableURIFactory.getInstance(baseUrl, url).toString(); } return converter.makeReplayURI(datespec, resolved); } catch (URIException e) { e.printStackTrace(); } return url; } }
u = UsableURIFactory.getInstance(u).toString(); } catch (URIException e) { e.printStackTrace();
u = UsableURIFactory.getInstance(u).toString(); } catch (URIException e) { e.printStackTrace();
u = UsableURIFactory.getInstance(u).toString(); } catch (URIException e) { e.printStackTrace();