PathSegmentImpl(final String path, final boolean decode) { this(path, decode, new MultivaluedStringMap()); }
PathSegmentImpl(final String path, final boolean decode) { this(path, decode, new MultivaluedStringMap()); }
private JerseyUriBuilder(final JerseyUriBuilder that) { this.scheme = that.scheme; this.ssp = that.ssp; this.authority = that.authority; this.userInfo = that.userInfo; this.host = that.host; this.port = that.port; this.path = new StringBuilder(that.path); this.matrixParams = that.matrixParams == null ? null : new MultivaluedStringMap(that.matrixParams); this.query = new StringBuilder(that.query); this.queryParams = that.queryParams == null ? null : new MultivaluedStringMap(that.queryParams); this.fragment = that.fragment; }
private JerseyUriBuilder(final JerseyUriBuilder that) { this.scheme = that.scheme; this.ssp = that.ssp; this.authority = that.authority; this.userInfo = that.userInfo; this.host = that.host; this.port = that.port; this.path = new StringBuilder(that.path); this.matrixParams = that.matrixParams == null ? null : new MultivaluedStringMap(that.matrixParams); this.query = new StringBuilder(that.query); this.queryParams = that.queryParams == null ? null : new MultivaluedStringMap(that.queryParams); this.fragment = that.fragment; }
/** * Decode the matrix component of a URI path segment. * * @param pathSegment the path segment component in encoded form. * @param decode true if the matrix parameters of the path segment component * should be in decoded form. * @return the multivalued map of matrix parameters. */ public static MultivaluedMap<String, String> decodeMatrix(final String pathSegment, final boolean decode) { final MultivaluedMap<String, String> matrixMap = new MultivaluedStringMap(); // Skip over path segment int s = pathSegment.indexOf(';') + 1; if (s == 0 || s == pathSegment.length()) { return matrixMap; } do { final int e = pathSegment.indexOf(';', s); if (e == -1) { decodeMatrixParam(matrixMap, pathSegment.substring(s), decode); } else if (e > s) { decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode); } s = e + 1; } while (s > 0 && s < pathSegment.length()); return matrixMap; }
/** * Decode the matrix component of a URI path segment. * * @param pathSegment the path segment component in encoded form. * @param decode true if the matrix parameters of the path segment component * should be in decoded form. * @return the multivalued map of matrix parameters. */ public static MultivaluedMap<String, String> decodeMatrix(final String pathSegment, final boolean decode) { final MultivaluedMap<String, String> matrixMap = new MultivaluedStringMap(); // Skip over path segment int s = pathSegment.indexOf(';') + 1; if (s == 0 || s == pathSegment.length()) { return matrixMap; } do { final int e = pathSegment.indexOf(';', s); if (e == -1) { decodeMatrixParam(matrixMap, pathSegment.substring(s), decode); } else if (e > s) { decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode); } s = e + 1; } while (s > 0 && s < pathSegment.length()); return matrixMap; }
final MultivaluedMap<String, String> queryParameters = new MultivaluedStringMap();
final MultivaluedMap<String, String> queryParameters = new MultivaluedStringMap();
@Override public Object apply(ContainerRequest containerRequest) { // TODO: cache? MultivaluedMap<String, String> cookies = new MultivaluedStringMap(); for (Map.Entry<String, Cookie> e : containerRequest.getCookies().entrySet()) { cookies.putSingle(e.getKey(), e.getValue().getValue()); } try { return extractor.extract(cookies); } catch (ExtractorException ex) { throw new ParamException.CookieParamException(ex.getCause(), extractor.getName(), extractor.getDefaultValueString()); } } }
@Override public Object apply(ContainerRequest containerRequest) { // TODO: cache? MultivaluedMap<String, String> cookies = new MultivaluedStringMap(); for (Map.Entry<String, Cookie> e : containerRequest.getCookies().entrySet()) { cookies.putSingle(e.getKey(), e.getValue().getValue()); } try { return extractor.extract(cookies); } catch (ExtractorException ex) { throw new ParamException.CookieParamException(ex.getCause(), extractor.getName(), extractor.getDefaultValueString()); } } }
final MultivaluedMap<String, String> map = new MultivaluedStringMap(); try { if (part != null) {
@Override public Object apply(ContainerRequest containerRequest) { // TODO: cache? MultivaluedMap<String, String> cookies = new MultivaluedStringMap(); for (Map.Entry<String, Cookie> e : containerRequest.getCookies().entrySet()) { cookies.putSingle(e.getKey(), e.getValue().getValue()); } try { return extractor.extract(cookies); } catch (ExtractorException ex) { throw new ParamException.CookieParamException(ex.getCause(), extractor.getName(), extractor.getDefaultValueString()); } } }
PathSegmentImpl(final String path, final boolean decode) { this(path, decode, new MultivaluedStringMap()); }
PathSegmentImpl(final String path, final boolean decode) { this(path, decode, new MultivaluedStringMap()); }
private JerseyUriBuilder(final JerseyUriBuilder that) { this.scheme = that.scheme; this.ssp = that.ssp; this.authority = that.authority; this.userInfo = that.userInfo; this.host = that.host; this.port = that.port; this.path = new StringBuilder(that.path); this.matrixParams = that.matrixParams == null ? null : new MultivaluedStringMap(that.matrixParams); this.query = new StringBuilder(that.query); this.queryParams = that.queryParams == null ? null : new MultivaluedStringMap(that.queryParams); this.fragment = that.fragment; }
private JerseyUriBuilder(final JerseyUriBuilder that) { this.scheme = that.scheme; this.ssp = that.ssp; this.authority = that.authority; this.userInfo = that.userInfo; this.host = that.host; this.port = that.port; this.path = new StringBuilder(that.path); this.matrixParams = that.matrixParams == null ? null : new MultivaluedStringMap(that.matrixParams); this.query = new StringBuilder(that.query); this.queryParams = that.queryParams == null ? null : new MultivaluedStringMap(that.queryParams); this.fragment = that.fragment; }
private JerseyUriBuilder(final JerseyUriBuilder that) { this.scheme = that.scheme; this.ssp = that.ssp; this.authority = that.authority; this.userInfo = that.userInfo; this.host = that.host; this.port = that.port; this.path = new StringBuilder(that.path); this.matrixParams = that.matrixParams == null ? null : new MultivaluedStringMap(that.matrixParams); this.query = new StringBuilder(that.query); this.queryParams = that.queryParams == null ? null : new MultivaluedStringMap(that.queryParams); this.fragment = that.fragment; }
public Version createVersion(String name) throws IOException { MultivaluedMap<String, String> params = new MultivaluedStringMap(); params.add("name", name); return invoke("https://bitbucket.org/api/1.0/repositories/{repoOwner}/{repoName}/issues/versions", "POST", Version.class, params, null); }
public Milestone createMilestone(String name) throws IOException { MultivaluedMap<String, String> params = new MultivaluedStringMap(); params.add("name", name); return invoke("https://bitbucket.org/api/1.0/repositories/{repoOwner}/{repoName}/issues/milestones", "POST", Milestone.class, params, null); }
public Issue setMilestone(Long issueId, String milestone) throws IOException { MultivaluedMap<String, String> query = new MultivaluedStringMap(); query.add("milestone", milestone); return invoke("https://bitbucket.org/api/1.0/repositories/{repoOwner}/{repoName}/issues/" + issueId, "PUT", Issue.class, query, null); } }