You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our application we need almost exactly what MimetypesFileTypeMap but we need to add some additional application specific paths that are searched. These come between searching the user's home folder, and searching in the Java runtime.
To achieve this, we currently extend MimetypesFileTypeMap and use reflection to get access to DB, confDir, and loadFile, loadResource, and loadAllResources.
This PR makes MimetypesFileTypeMap extensible so that it is no longer necessary to use reflection to access its members and methods.
I am not sure how this will be received, but I am sending it over to get some feedback.
Another possible alternative approach would be to adapt MimetypesFileTypeMap so that its constructor accepts an optional list of paths to search. Those paths would also need priorities supplied with them, so overall MimetypesFileTypeMap knows which path to check first, i.e. should a path come before checking the user's home, or perhaps after checking the Java runtime.
@adamretter thanks for the PR. I'll hold off on review until I understand want you need.
Another possible alternative approach would be to adapt MimetypesFileTypeMap so that its constructor accepts an optional list of paths to search. Those paths would also need priorities supplied with them
FileInputStream + SequenceInputStream + MimetypesFileTypeMap(InputStream) constructor should do what you want. How does that work for you?
FileInputStream + SequenceInputStream + MimetypesFileTypeMap(InputStream) constructor should do what you want. How does that work for you?
I am not sure that would help as the InputStream given to MimetypesFileTypeMap(InputStream) would have the highest priority, but I would like mine to come between searching the user's home folder, and searching in the Java runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In our application we need almost exactly what
MimetypesFileTypeMapbut we need to add some additional application specific paths that are searched. These come between searching the user's home folder, and searching in the Java runtime.To achieve this, we currently extend
MimetypesFileTypeMapand use reflection to get access toDB,confDir, andloadFile,loadResource, andloadAllResources.This PR makes
MimetypesFileTypeMapextensible so that it is no longer necessary to use reflection to access its members and methods.I am not sure how this will be received, but I am sending it over to get some feedback.
Another possible alternative approach would be to adapt
MimetypesFileTypeMapso that its constructor accepts an optional list of paths to search. Those paths would also need priorities supplied with them, so overallMimetypesFileTypeMapknows which path to check first, i.e. should a path come before checking the user's home, or perhaps after checking the Java runtime.