Skip to content

Instantly share code, notes, and snippets.

@rmcdouga
Last active April 6, 2023 12:26
Show Gist options
  • Save rmcdouga/9c2cb189566014d46f4ce54290b223c7 to your computer and use it in GitHub Desktop.
Save rmcdouga/9c2cb189566014d46f4ce54290b223c7 to your computer and use it in GitHub Desktop.
Jakarta Activation Wish List
  1. Add a ByteArrayDataSource
    This seems like an odd ommission, surely an in-memory data source makes sense and is trivial to implement (but no more trivial than FileDataSource). It would save people from having to implement this in many places.

  2. Move Implementation tests into API project, convert to JUnit 5
    The jakarta.activation apis are a mix of API and implementation. Is there any reason why the implementation pieces are not tested within the API project? Having the tests closer to the code would ease the maintenance burdon and be more in line with modern practices. This will help new contributors.

  3. Add "name" attribute
    This is a common requirement - similar to having a content-type. The name can be Optional and can contain things like a filename, or other types of names to identify the data source.

  4. Add ability to have other "metadata" attributes
    This is a more theoritical requirement. I haven't required it, but I can see that others might.

  5. Create "reverse lookup" MimetypesFileTypeMap for looking up extensions
    This is just a reimplementation of MimetypesFileTypeMap which already contains all the information required. We would just need to add some new methods and alter the implementation. This would allow someone, given a content-type to determine what extension to use for that file. Maybe create a new interface (MimetypesMap?) that implements the reverse lookup and add that interface to MimetypesFileTypeMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment