Skip to content
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

Open
wants to merge 1 commit into
base: releases/22.0
Choose a base branch
from

Conversation

jmiserez
Copy link
Member

Adds methods to DynamicResourceLoader and DynamicResourceInfo to allow loading of a BinaryResource internally, using the URL but without requiring a HTTP request.

329612

- Adds methods to DynamicResourceLoader and DynamicResourceInfo to allow
  loading of a BinaryResource internally, using the URL but without
  requiring a HTTP request.

329612
@jmiserez jmiserez marked this pull request as ready for review March 21, 2024 13:47
@jmiserez jmiserez self-assigned this Mar 21, 2024
@jmiserez jmiserez requested a review from fschinkel March 21, 2024 13:49
* @param path
* decoded path (non url-encoded)
*/
public static DynamicResourceInfo fromPath(Function<String/*uiSessionId*/, IUiSession> uiSessionResolver, Function<String/*id*/, IJsonAdapter> jsonAdapterResolver, String path) {
Copy link
Member

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);
Copy link
Member

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) {
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants