{"id":15508369,"url":"https://github.com/honoluluhenk/http-content-disposition","last_synced_at":"2026-02-16T19:13:04.065Z","repository":{"id":101355548,"uuid":"276726898","full_name":"HonoluluHenk/http-content-disposition","owner":"HonoluluHenk","description":"Java library for building the HTTP Content-Disposition conforming to RFC6266, RFC5987 (opinionated but correct)","archived":false,"fork":false,"pushed_at":"2024-05-06T21:16:46.000Z","size":186,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T21:19:14.669Z","etag":null,"topics":["content-disposition","http","rfc-6266"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HonoluluHenk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T19:13:08.000Z","updated_at":"2024-05-06T21:01:50.000Z","dependencies_parsed_at":"2024-05-06T21:43:43.623Z","dependency_job_id":"3aed7ef5-e45f-42dd-8d18-b0a9436d73a7","html_url":"https://github.com/HonoluluHenk/http-content-disposition","commit_stats":{"total_commits":43,"total_committers":2,"mean_commits":21.5,"dds":"0.046511627906976716","last_synced_commit":"92e4c46331c4ac35df3dbe90b9d99d88f7932545"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/HonoluluHenk/http-content-disposition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HonoluluHenk%2Fhttp-content-disposition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HonoluluHenk%2Fhttp-content-disposition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HonoluluHenk%2Fhttp-content-disposition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HonoluluHenk%2Fhttp-content-disposition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HonoluluHenk","download_url":"https://codeload.github.com/HonoluluHenk/http-content-disposition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HonoluluHenk%2Fhttp-content-disposition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272020594,"owners_count":24859852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["content-disposition","http","rfc-6266"],"created_at":"2024-10-02T09:38:04.917Z","updated_at":"2026-02-16T19:12:59.020Z","avatar_url":"https://github.com/HonoluluHenk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-content-disposition\n\nImplements generating a HTTP  `Content-Disposition` header conforming to [RFC 6266](https://tools.ietf.org/html/rfc6266) for the Java language.\n\nOther Java libraries do not adhere to the RFC 6266 standard \n([JavaMail MimeUtility#encodeWord](https://javaee.github.io/javamail/docs/api/javax/mail/internet/MimeUtility.html) looks fine on first glance but breaks for more esoteric UTF characters) \nor come with huge dependency baggage \n([Spring ContentDisposition](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/ContentDisposition.html) comes to mind).\n\n\n# Background\n\nThe Content-Disposition header was originally specified to only support a subset of characters of the [ISO-8859-1 character set](https://de.wikipedia.org/wiki/ISO_8859-1).\n\nSince most systems support more characters, RFC 6266 came into life to adapt some existing [old RFC used by emails](https://tools.ietf.org/html/rfc2183) to the world of HTTP and UTF-8.\n\n\n# Deviance from the RFC\n\nA minor difference is: the RFC requires \n\n* either the old ISO-8859-1 attribute\n\n * or the encoded extended attribute.\n\nThis library provides both for a much improved compatibility with broken/old clients.\n\n\n\n# Maven/Gradle dependency\nThis library is released as a maven artifact on [jitpack.io](https://jitpack.io).\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003cname\u003ejitpack.io-releases\u003c/name\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.github.HonoluluHenk\u003c/groupId\u003e\n\t\u003cartifactId\u003ehttp-content-disposition\u003c/artifactId\u003e\n\t\u003cversion\u003esee-github-releases\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAvailable versions: see [Github releases](https://github.com/HonoluluHenk/http-content-disposition/releases).\n\n\n# Usage\n\n## Basic usage\n\n```java\nvoid addHeader(HttpServletResponse response) {\n    HttpContentDisposition header = HttpContentDisposition.builder()\n        //.disposition(Disposition.INLINE)\n        .disposition(Disposition.ATTACHMENT)\n        .filename(\"I ❤ special characters\")\n        .build();\n\n    response.addHeader(header.headerName(), header.headerValue());\n}\n```\n\nThis will generate the HTTP header:\n\n`Content-Disposition: attachment; filename=\"I ? special characters\"; filename*=UTF-8''I%20%E2%9D%A4%20special%20characters`\n\n\n\nThe ISO-8859-1 filename is automatically generated by doing simple Charset conversion\n\n\n\n## Customizations\n\n### Conversion to ISO-8859-1\n\nIn case you do not want the default character set conversion or want to supply a completely different text, you may supply your implementation of `IsoFallback` to HttpContentDisposition/the builder.\n\nYou may pass a string to the existing `OverrideIsoFallback` to override the ISO filename completely.\n\n\n\n```java\nHttpContentDisposition header = HttpContentDisposition.builder()\n    .disposition(Disposition.ATTACHMENT)\n    .filename(\"I ❤ special characters\")\n    .isoFallback(new OverrideIsoFallback(\"I (heart) special characters\"))\n    // convenience:\n    //.isoFallbackValue(\"I (heart) special characters\")\n    .build();\n\n```\n\n\n\n# License\n\nGNU Lesser General Public License 3.0 ([LGPL-3.0](http://www.gnu.org/licenses/lgpl-3.0.html)) or later.\n\nSee also: [LICENSE.txt](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonoluluhenk%2Fhttp-content-disposition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonoluluhenk%2Fhttp-content-disposition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonoluluhenk%2Fhttp-content-disposition/lists"}