-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the core ResourceService a bit more reusable for subclasses #12281
base: jetty-12.0.x
Are you sure you want to change the base?
Make the core ResourceService a bit more reusable for subclasses #12281
Conversation
- The goal is to allow a subclass to look at incoming Request and HttpContent objects and customize processing - Refactor sendDirectory() to call a new getDirectoryResource() method - Make sendData() protected
CC: @lorban |
Can you share an example of subclass you'd like to create? Feel free to modify Thanks! |
Here is what I am after and I can update this PR is the idea is acceptable. The code I currently have is hard-coded to Jetty EE9 classes, but there is nothing really EE9 about it. I would prefer to configure Jetty using Core classes. I've recently refactored it to make it work with Jetty Core and EE9 without too much duplication, but I can't quite get there cleanly with the way Jetty Core classes are written today. I have a class I do not want/cannot use a Jetty resource Factory because of the use case I'll outline later. I believe the above could be folder into the Core I am not suggesting the following is appropriate for Jetty but this is what we need: A subclass of EE9 The above all works as Jetty EE9 code. I think this would be better as Jetty Core code. The scope of the PR would be to edit Jetty Core and Jetty EE9 such that each |
You can wrap Resource, and that can provide the regex based filter in |
Having But I think having it as You can do it via regex, someone else could do it via filenames, someone else could do it via |
Opening up the internals of |
Thank you all for the suggestions. I'll update this PR over the next couple of days. |
Make the core
ResourceService
a bit more reusable for subclassesRequest
andHttpContent
objects and customize processingsendDirectory()
to call a newgetSendDirectoryResource()
method