-
Notifications
You must be signed in to change notification settings - Fork 25
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
Resource API #316
Resource API #316
Conversation
Very cool! I think a follow up with a loader API would be most useful too |
classloader/src/main/java/io/smallrye/common/classloader/resource/InMemoryResource.java
Outdated
Show resolved
Hide resolved
I'm making some changes based on wanting a resource loader API as well (adding a canonical relative path to |
Once we get the new Resource Loader API, should we deprecate |
Good question. I'll see if rewriting them with the new APIs is feasible and I'll probably have a better answer then. |
d854203
to
c45bc9b
Compare
OK, here's where we stand with this. We have There are implementations for JAR file entries, URLs, Then there's the It should be possible to reimplement (or replace our usages of) |
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.
Very nice!
I added a couple of small quesrions
resource/src/main/java/io/smallrye/common/resource/PathResource.java
Outdated
Show resolved
Hide resolved
b8afb37
to
e02c675
Compare
We use it in SmallRye Config (and maybe other SmallRye projects are using it too). We had some discussions about moving SmallRye to Java 17 a few months ago, and we decided to wait a little longer. We probably need to revisit that discussion. |
} | ||
} | ||
|
||
private static JarFileResourceLoader makeJar(Entry... entries) throws IOException { |
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.
We have shrinkwrap
as a test dependency in other modules to help with this if you prefer. We can also use it here.
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.
I prefer to keep it simple in this case, since these tests may require detailed control over the archive format for specific reasons.
I can wait on |
Proposed resource API. Provides a uniform API for reading resources from the class path or filesystem.
Non-goals are presently including: