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

Enable loading the UserSchemaExtension from a classpath resource #378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klaasdellschaft
Copy link

Purpose

When using Charon in the context of a Spring Boot application, typically all resources needed by the application are packaged into the jar file together with all of the application's classes. In this case, it is not directly possible to read that classpath resource via a FileInputStream. In order to still be able to load a UserSchemaExtension, currently a workaround would need to applied in the application, i.e. the classpath resource would need to be copied to a temporary file, and then the temporary file would need to be deleted after being loaded by SCIMUserSchemaExtensionBuilder.

Goals

In order to avoid this workaround, I added a further method to SCIMUserSchemaExtensionBuilder which it loads the schema from any InputStream. When using this newly introduced method, the application is responsible for opening and closing that stream (and handling the exceptions that may appear during opening and closing).

The solution is fully backwards compatible, i.e. the previous method signature buildUserSchemaExtension(String configFilePath) is still available, and it behaves the same as before. Only a new method buildUserSchemaExtension(InputStream inputStream) has been made available.

…. a file packaged into the application's jar file

The change is fully backwards compatible, i.e. the previous method signature `buildUserSchemaExtension(String configFilePath)` is still available, and it behaves the same as before. Only a new method `buildUserSchemaExtension(InputStream inputStream)` has been made available.
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.

1 participant