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
DynamicResourceLoader: allow internal loading of binary resources #956
base: releases/22.0
Are you sure you want to change the base?
DynamicResourceLoader: allow internal loading of binary resources #956
Conversation
- Adds methods to DynamicResourceLoader and DynamicResourceInfo to allow loading of a BinaryResource internally, using the URL but without requiring a HTTP request. 329612
* @param path | ||
* decoded path (non url-encoded) | ||
*/ | ||
public static DynamicResourceInfo fromPath(Function<String/*uiSessionId*/, IUiSession> uiSessionResolver, Function<String/*id*/, IJsonAdapter> jsonAdapterResolver, String path) { |
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.
uiSessionResolver
is not really used. It is called and the result is validated (matching ids), but the resulting IUiSession
is not used. Therefore, delete the parameter or use it to validate the IJsonAdapter
.
} | ||
// resolve session id and adapter id | ||
IUiSession uiSession = Optional.ofNullable(parts.getUiSessionId()).map(uiSessionResolver).orElse(null); | ||
IJsonAdapter jsonAdapter = Optional.ofNullable(parts.getAdapterId()).map(jsonAdapterResolver).orElse(null); |
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.
call jsonAdapterResolver
after validating the uiSession
return localResourceHolder.get(); | ||
} | ||
|
||
protected static IBinaryResourceProvider getBinaryResourceProvider(IUiSession uiSession, String adapterId) { |
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 do not change this to static on a released version as it might break existing projects.
Adds methods to DynamicResourceLoader and DynamicResourceInfo to allow loading of a BinaryResource internally, using the URL but without requiring a HTTP request.
329612