/** * Returns an array of {@link HeaderElement}s constructed from my value. * * @see BasicHeaderValueParser#parseElements(String, HeaderValueParser) * * @return an array of header elements * * @throws ParseException in case of a parse error */ public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
public HeaderElement[] getElements() throws ParseException { ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor); }
@Override public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
@Override public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
@Override public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
/** * Returns an array of {@link HeaderElement}s constructed from my value. * * @see BasicHeaderValueParser#parseElements(String, HeaderValueParser) * * @return an array of header elements * * @throws ParseException in case of a parse error */ public HeaderElement[] getElements() throws ParseException { if (this.value != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.value, null); } else { return new HeaderElement[] {}; } }
public HeaderElement[] getElements() { if (elements == null) { elements = BasicHeaderValueParser.parseElements(value.toString(), BasicHeaderValueParser.INSTANCE); } return elements; }
private String extractFileNameFrom(String contentDisposition) { HeaderElement[] elements = BasicHeaderValueParser.parseElements(contentDisposition, null); return Arrays.stream(elements) .filter(element -> "attachment".equalsIgnoreCase(element.getName())) .findAny() .map(element -> element.getParameterByName("filename")) .map(NameValuePair::getValue) .orElse(""); }
@Override public HeaderElement[] getElements() throws ParseException { if (this.getValue() != null) { // result intentionally not cached, it's probably not used again return BasicHeaderValueParser.parseElements(this.getValue(), null); } return EMPTY_HEADER_ELEMENTS; }
public String getBoundary() { String contentTypeValue = getType(); HeaderElement[] contentType = BasicHeaderValueParser.parseElements(contentTypeValue, new BasicHeaderValueParser()); if (contentType.length != 1) throw new IllegalArgumentException("Multipart response appears to have a bad Content-Type: header value: " + contentTypeValue); NameValuePair boundaryNV = contentType[0].getParameterByName("boundary"); if (boundaryNV == null) return null; return unescapeBoundary(boundaryNV.getValue()); }
@Override public HeaderElement[] getElements() throws ParseException { final ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor); }
public HeaderElement[] getElements() throws ParseException { ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor); }
public HeaderElement[] getElements() throws ParseException { ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor); }
@Override public HeaderElement[] getElements() throws ParseException { final ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor); }
public HeaderElement[] getElements() throws ParseException { ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor); }
@Override public HeaderElement[] getElements() throws ParseException { final ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor); }
@Override public HeaderElement[] getElements() throws ParseException { final ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor); }
public HeaderElement[] getElements() throws ParseException { final ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor); }
public HeaderElement[] getElements() throws ParseException { ParserCursor cursor = new ParserCursor(0, this.buffer.length()); cursor.updatePos(this.valuePos); return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor); }