/** * Does a URL encoding of the <code>string</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. * * @param string the string to encode * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string) { return escape(string, '%'); }
/** * Does a URL encoding of the <code>string</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. * * @param string the string to encode * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string) { return escape(string, '%'); }
/** * Does a URL encoding of the <code>string</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. * * @param string the string to encode * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string) { return escape(string, '%'); }
/** * Does a URL encoding of the <code>string</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. * * @param string the string to encode * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string) { return escape(string, '%'); }
/** * Does a URL encoding of the <code>string</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. * * @param string the string to encode * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string) { return escape(string, '%'); }
/** * Does a URL encoding of the <code>path</code>. The characters that * don't need encoding are those defined 'unreserved' in section 2.3 of * the 'URI generic syntax' RFC 2396. In contrast to the * {@link #escape(String)} method, not the entire path string is escaped, * but every individual part (i.e. the slashes are not escaped). * * @param path the path to encode * @return the escaped path * @throws NullPointerException if <code>path</code> is <code>null</code>. */ public static String escapePath(String path) { return escape(path, '%', true); }
/** * Does an URL encoding of the <code>string</code> using the * <code>escape</code> character. The characters that don't need encoding * are those defined 'unreserved' in section 2.3 of the 'URI generic syntax' * RFC 2396, but without the escape character. * * @param string the string to encode. * @param escape the escape character. * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string, char escape) { return escape(string, escape, false); }
/** * Does an URL encoding of the <code>string</code> using the * <code>escape</code> character. The characters that don't need encoding * are those defined 'unreserved' in section 2.3 of the 'URI generic syntax' * RFC 2396, but without the escape character. * * @param string the string to encode. * @param escape the escape character. * @return the escaped string * @throws NullPointerException if <code>string</code> is <code>null</code>. */ public static String escape(String string, char escape) { return escape(string, escape, false); }
@Override public String apply(Principal input) { return Text.escape(input.getName()); } }));
@Override public String apply(Principal input) { return Text.escape(input.getName()); } }));
private String getWorkspaceURI(SessionInfo sessionInfo) { StringBuilder sb = new StringBuilder(); sb.append(jcrServerURI); sb.append(Text.escape(sessionInfo.getWorkspaceName())); return sb.toString(); }
String getWorkspaceUri(String workspaceName) { String workspaceUri = getRepositoryUri(); if (workspaceName != null) { workspaceUri += Text.escape(workspaceName); } return workspaceUri; }
String getWorkspaceUri(String workspaceName) { String workspaceUri = getRepositoryUri(); if (workspaceName != null) { workspaceUri += Text.escape(workspaceName); } return workspaceUri; }
@Override public String apply(Group input) { return Text.escape(input.getName()); } }));
private String getWorkspaceURI(SessionInfo sessionInfo) { StringBuilder sb = new StringBuilder(); sb.append(jcrServerURI); sb.append(Text.escape(sessionInfo.getWorkspaceName())); return sb.toString(); }
private static String generateLinkHeaderFieldValue(SessionInfo sessionInfo, boolean isReadAccess) { StringBuilder linkHeaderField = new StringBuilder(); String sessionIdentifier = ((SessionInfoImpl) sessionInfo).getSessionIdentifier(); linkHeaderField.append("<").append(sessionIdentifier).append(">; rel=\"") .append(JcrRemotingConstants.RELATION_REMOTE_SESSION_ID).append("\""); String userdata = ((SessionInfoImpl) sessionInfo).getUserData(); if (userdata != null && !isReadAccess) { String escaped = Text.escape(userdata); linkHeaderField.append(", <data:,").append(escaped).append(">; rel=\"").append(JcrRemotingConstants.RELATION_USER_DATA) .append("\""); } return linkHeaderField.toString(); }
private String getItemUri(NodeId parentId, Name childName, SessionInfo sessionInfo) throws RepositoryException { String parentUri = uriResolver.getItemUri(parentId, sessionInfo.getWorkspaceName(), sessionInfo); NamePathResolver resolver = getNamePathResolver(sessionInfo); // JCR-2920: don't append '/' to a trailing '/' if (!parentUri.endsWith("/")) { parentUri += "/"; } return parentUri + Text.escape(resolver.getJCRName(childName)); }
private String getItemUri(NodeId parentId, Name childName, SessionInfo sessionInfo) throws RepositoryException { String parentUri = uriResolver.getItemUri(parentId, sessionInfo.getWorkspaceName(), sessionInfo); NamePathResolver resolver = getNamePathResolver(sessionInfo); // JCR-2920: don't append '/' to a trailing '/' if (!parentUri.endsWith("/")) { parentUri += "/"; } return parentUri + Text.escape(resolver.getJCRName(childName)); }
public DavResource getCollection() { try { DavResourceLocator locator = getLocator(); DavResourceLocator parentLocator = locator.getFactory().createResourceLocator(Text.escape(locator.getPrefix()), Text.escape(getParentResourcePath())); return getFactory().createResource(parentLocator, getSession()); } catch (DavException de) { throw new RuntimeException(de); } }