protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException { if (name instanceof URLFileName) { final URLFileName urlName = (URLFileName) getName(); // TODO: charset return new URL(urlName.getURIEncoded(null)); } return new URL(getName().getURI()); }
protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException { if (name instanceof URLFileName) { final URLFileName urlName = (URLFileName) getName(); // TODO: charset return new URL(urlName.getURIEncoded(null)); } return new URL(getName().getURI()); }
protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException { if (name instanceof URLFileName) { final URLFileName urlName = (URLFileName) getName(); // TODO: charset return new URL(urlName.getURIEncoded(null)); } return new URL(getName().getURI()); }
/** * Convert the FileName to an encoded url String. * * @param name The FileName. * @return The encoded URL String. */ private String hrefString(final URLFileName name) { final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), null, null, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } }
/** * Convert the FileName to an encoded url String. * * @param name The FileName. * @return The encoded URL String. */ private String hrefString(final URLFileName name) { final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), null, null, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } }
/** * Convert the FileName to an encoded url String. * * @param name The FileName. * @return The encoded URL String. */ private String hrefString(final URLFileName name) { final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), null, null, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } }
/** * Converts the given URLFileName to an encoded URL String. * * @param name The FileName. * @param includeUserInfo true if user information should be included. * @return The encoded URL String. */ private String toUrlString(final URLFileName name, final boolean includeUserInfo) { String user = null; String password = null; if (includeUserInfo) { user = name.getUserName(); password = name.getPassword(); } final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), user, password, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } } }
/** * Converts the given URLFileName to an encoded URL String. * * @param name The FileName. * @param includeUserInfo true if user information should be included. * @return The encoded URL String. */ private String toUrlString(final URLFileName name, final boolean includeUserInfo) { String user = null; String password = null; if (includeUserInfo) { user = name.getUserName(); password = name.getPassword(); } final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), user, password, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } } }
/** * Converts the given URLFileName to an encoded URL String. * * @param name The FileName. * @param includeUserInfo true if user information should be included. * @return The encoded URL String. */ private String toUrlString(final URLFileName name, final boolean includeUserInfo) { String user = null; String password = null; if (includeUserInfo) { user = name.getUserName(); password = name.getPassword(); } final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), user, password, name.getPath(), name.getType(), name.getQueryString()); try { return newFile.getURIEncoded(this.getUrlCharset()); } catch (final Exception e) { return name.getURI(); } } }