@Test public void testFilename() { ContentDisposition cd = ContentDisposition.parse("attachment; filename=index.html"); assertThat(cd.type(), is(equalTo("attachment"))); assertThat(cd.filename().isPresent(), is(equalTo(true))); assertThat(cd.filename().get(), is(equalTo("index.html"))); assertThat(cd.parameters(), is(notNullValue())); assertThat(cd.parameters().size(), is(equalTo(1))); }
public Optional<String> filename() { String filename = null; String value = parameters.get(FILENAME_PARAMETER); if (value != null) { filename = URLDecoder.decode(value, StandardCharsets.UTF_8); } return Optional.ofNullable(filename); }
ContentDisposition { public Optional<String> filename() { String filename = null; String value = parameters.get(FILENAME_PARAMETER); if (value != null) { filename = URLDecoder.decode(value, StandardCharsets.UTF_8); } return Optional.ofNullable(filename); } }
ContentDisposition { public Optional<String> filename() { String filename = null; String value = parameters.get(FILENAME_PARAMETER); if (value != null) { filename = URLDecoder.decode(value, StandardCharsets.UTF_8); } return Optional.ofNullable(filename); } private  ContentDisposition(String type, Map<String, String> params); }
ContentDisposition { public Optional<String> filename() { String filename = null; String value = parameters.get(FILENAME_PARAMETER); if (value != null) { filename = URLDecoder.decode(value, StandardCharsets.UTF_8); } return Optional.ofNullable(filename); } private  ContentDisposition(String type, Map<String, String> params); String type(); Optional<String> name(); Optional<String> filename(); Optional<ZonedDateTime> creationDate(); Optional<ZonedDateTime> modificationDate(); Optional<ZonedDateTime> readDate(); OptionalLong size(); Map<String, String> parameters(); @Override String toString(); static Builder builder(); }
ContentDisposition { public Optional<String> filename() { String filename = null; String value = parameters.get(FILENAME_PARAMETER); if (value != null) { filename = URLDecoder.decode(value, StandardCharsets.UTF_8); } return Optional.ofNullable(filename); } private  ContentDisposition(String type, Map<String, String> params); String type(); Optional<String> name(); Optional<String> filename(); Optional<ZonedDateTime> creationDate(); Optional<ZonedDateTime> modificationDate(); Optional<ZonedDateTime> readDate(); OptionalLong size(); Map<String, String> parameters(); @Override String toString(); static Builder builder();  }