/** * Returns the optionnally decoded authority component. * * @param decode * Indicates if the result should be decoded using the * {@link #decode(String)} method. * @return The optionnally decoded authority component. * @see #getAuthority() */ public String getAuthority(boolean decode) { return decode ? decode(getAuthority()) : getAuthority(); }
/** * Returns the optionnally decoded authority component. * * @param decode * Indicates if the result should be decoded using the {@link #decode(String)} method. * @return The optionnally decoded authority component. * @see #getAuthority() */ public String getAuthority(boolean decode) { return decode ? decode(getAuthority()) : getAuthority(); }
/** * Returns the optionnally decoded authority component. * * @param decode * Indicates if the result should be decoded using the * {@link #decode(String)} method. * @return The optionnally decoded authority component. * @see #getAuthority() */ public String getAuthority(boolean decode) { return decode ? decode(getAuthority()) : getAuthority(); }
/** * Returns the user info component for server based hierarchical * identifiers.<br> * Note that no URI decoding is done by this method. * * @return The user info component for server based hierarchical * identifiers. */ public String getUserInfo() { String result = null; final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); if (index != -1) { result = authority.substring(0, index); } } return result; }
/** * Returns the user info component for server based hierarchical * identifiers.<br> * Note that no URI decoding is done by this method. * * @return The user info component for server based hierarchical * identifiers. */ public String getUserInfo() { String result = null; final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); if (index != -1) { result = authority.substring(0, index); } } return result; }
/** * Returns the host identifier. Includes the scheme, the host name and the * host port number.<br> * Note that no URI decoding is done by this method. * * @return The host identifier. */ public String getHostIdentifier() { final StringBuilder result = new StringBuilder(); result.append(getScheme()).append("://").append(getAuthority()); return result.toString(); }
/** * Returns the user info component for server based hierarchical * identifiers.<br> * Note that no URI decoding is done by this method. * * @return The user info component for server based hierarchical * identifiers. */ public String getUserInfo() { String result = null; final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); if (index != -1) { result = authority.substring(0, index); } } return result; }
/** * Returns the host identifier. Includes the scheme, the host name and the * host port number.<br> * Note that no URI decoding is done by this method. * * @return The host identifier. */ public String getHostIdentifier() { final StringBuilder result = new StringBuilder(); result.append(getScheme()).append("://").append(getAuthority()); return result.toString(); }
/** * Returns the host identifier. Includes the scheme, the host name and the * host port number.<br> * Note that no URI decoding is done by this method. * * @return The host identifier. */ public String getHostIdentifier() { final StringBuilder result = new StringBuilder(); result.append(getScheme()).append("://").append(getAuthority()); return result.toString(); }
/** * Sets the user info component for server based hierarchical identifiers. * * @param userInfo * The user info component for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority part has not been defined. */ public void setUserInfo(String userInfo) { final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); final String newUserInfo = (userInfo == null) ? "" : userInfo + '@'; if (index != -1) { setAuthority(newUserInfo + authority.substring(index + 1)); } else { setAuthority(newUserInfo + authority); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
/** * Sets the optional port number for server based hierarchical identifiers. * * @param port * The optional port number for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority has not been defined. */ public void setHostPort(Integer port) { final String authority = getAuthority(); if (authority != null) { // We must prevent the case where the userinfo part contains ':' // and the case of IPV6 addresses int indexUI = authority.indexOf('@'); // user info int indexIPV6 = authority.indexOf(']'); // IPV6 int index = authority.indexOf(':', (indexIPV6 == -1) ? indexUI : indexIPV6); String newPort = (port == null) ? "" : ":" + port; if (index != -1) { setAuthority(authority.substring(0, index) + newPort); } else { setAuthority(authority + newPort); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
/** * Sets the user info component for server based hierarchical identifiers. * * @param userInfo * The user info component for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority part has not been defined. */ public void setUserInfo(String userInfo) { final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); final String newUserInfo = (userInfo == null) ? "" : userInfo + '@'; if (index != -1) { setAuthority(newUserInfo + authority.substring(index + 1)); } else { setAuthority(newUserInfo + authority); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
/** * Returns the optional port number for server based hierarchical * identifiers. * * @return The optional port number for server based hierarchical * identifiers or -1 if the port number does not exist. */ public int getHostPort() { int result = -1; final String authority = getAuthority(); if (authority != null) { final int index1 = authority.indexOf('@'); // We must prevent the case where the userinfo part contains ':' final int index = authority.indexOf(':', (index1 == -1 ? 0 : index1)); if (index != -1) { try { result = Integer.parseInt(authority.substring(index + 1)); } catch (NumberFormatException nfe) { Context.getCurrentLogger().log( Level.WARNING, "Can't parse hostPort : [hostRef,requestUri]=[" + getBaseRef() + "," + this.internalRef + "]"); } } } return result; }
/** * Sets the user info component for server based hierarchical identifiers. * * @param userInfo * The user info component for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority part has not been defined. */ public void setUserInfo(String userInfo) { final String authority = getAuthority(); if (authority != null) { final int index = authority.indexOf('@'); final String newUserInfo = (userInfo == null) ? "" : userInfo + '@'; if (index != -1) { setAuthority(newUserInfo + authority.substring(index + 1)); } else { setAuthority(newUserInfo + authority); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
final String authority = getAuthority();
/** * Sets the optional port number for server based hierarchical identifiers. * * @param port * The optional port number for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority has not been defined. */ public void setHostPort(Integer port) { final String authority = getAuthority(); if (authority != null) { final int index1 = authority.indexOf('@'); // We must prevent the case where the userinfo part contains ':' final int index = authority.indexOf(':', (index1 == -1 ? 0 : index1)); final String newPort = (port == null) ? "" : ":" + port; if (index != -1) { setAuthority(authority.substring(0, index) + newPort); } else { setAuthority(authority + newPort); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
final String authority = getAuthority();
/** * Sets the optional port number for server based hierarchical identifiers. * * @param port * The optional port number for server based hierarchical * identifiers. * @throws IllegalArgumentException * If the autority has not been defined. */ public void setHostPort(Integer port) { final String authority = getAuthority(); if (authority != null) { // We must prevent the case where the userinfo part contains ':' // and the case of IPV6 addresses int indexUI = authority.indexOf('@'); // user info int indexIPV6 = authority.indexOf(']'); // IPV6 int index = authority.indexOf(':', (indexIPV6 == -1) ? indexUI : indexIPV6); String newPort = (port == null) ? "" : ":" + port; if (index != -1) { setAuthority(authority.substring(0, index) + newPort); } else { setAuthority(authority + newPort); } } else { throw new IllegalArgumentException( "No authority defined, please define a host name first"); } }
@Override protected void handleLocal(Request request, Response response, String decodedPath) { String scheme = request.getResourceRef().getScheme(); if (scheme.equalsIgnoreCase(Protocol.OBAP.getSchemeName())) { Bundle bundle = BUNDLE_CACHE.get(request.getResourceRef() .getAuthority()); getLogger().fine( "Look for bundle " + request.getResourceRef().getAuthority()); handleBundle(request, response, bundle); } else { throw new IllegalArgumentException( "Protocol \"" + scheme + "\" not supported by the connector. Only OBAP is supported."); } }
result = reference.getAuthority(); } else if (partName.startsWith("b")) { result = getReferenceContent(partName.substring(1),