/** * Extracts the Location header of this Result value if this Result is a Redirect. * * @return the location (if it was set) */ public Optional<String> redirectLocation() { return header(LOCATION); }
/** * Extracts the Location header of this Result value if this Result is a Redirect. * * @return the location (if it was set) */ public Optional<String> redirectLocation() { return header(LOCATION); }
/** * Extracts the Location header of this Result value if this Result is a Redirect. * * @return the location (if it was set) */ public Optional<String> redirectLocation() { return header(LOCATION); }
/** * Extracts the Location header of this Result value if this Result is a Redirect. */ default String redirectLocation() { return header(LOCATION); }
/** * Extracts the Content-Type of this Result value. */ default String contentType() { String h = header(CONTENT_TYPE); if(h == null) return null; if(h.contains(";")) { return h.substring(0, h.indexOf(";")).trim(); } else { return h.trim(); } }
/** * Extracts the Charset of this Result value. */ default String charset() { String h = header(CONTENT_TYPE); if(h == null) return null; if(h.contains("; charset=")) { return h.substring(h.indexOf("; charset=") + 10, h.length()).trim(); } else { return null; } }