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
HttpHeaderInjection to include headers optional modules #939
Conversation
Needed by fcrepo4/fcrepo-module-auth-webac#48 |
* @since 2015-10-30 | ||
*/ | ||
@Component | ||
public class HttpHeaderInjection implements ApplicationContextAware { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small thing, but wouldn't this read better as HttpHeaderInjector
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer subclassing ApplicationObjectSupport
to impl'ing ApplicationContextAware
.
Sorry @ajs6f , I switched back to implementing ApplicationContextAware to avoid the NullPointerExceptions occurring (seemingly) because this only pulls from the external WebAC module currently. |
It's just a plain generic. The bounds don't matter at all. You have one method: |
If you have resolved the injection problems, why not switch back to |
I did switch back to As for the generics, would we filter for the type in each utility? Because I am guessing both the HttpTripleUtil and the HttpHeaderInjector would grab each others classes, but we would only want to execute our own to ensure we get the correct output (RDF vs headers). |
No, that shouldn't be giving you an NPE, at least not the way I understand it now. It should work the same way as does the injection of |
You could filter, or I think you could use the type of |
Alright, the NPE is because I was not instantiating the ApplicationObjectSupport correctly. So that is solved. |
MAXIMIZE THE SOLVED! |
Forgive my ignorance, but if |
No, I'm saying you try to give each factory a supertype, e.g. |
/** | ||
* Given a resource and session, update the JAX-RS response with any additional headers. | ||
* | ||
* @param uriInfo the UriInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide even more meaningful javadocs: uriInfo
, resource
, and return
.
Resolved with: 0977142 |
Address FCREPO-1795