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
config.properties is quite a generic name to exist in the root of the classpath.
Unfortunately, the standard classloader, when getResourceAsStream is called, will search the classpath root, and adjacent to the class [0]. Empirical evidence [see test case below] suggests that it looks next to the class first e.g. with the class and package being com.bitmovin.api.BitmovinApi it will look for /com/bitmovin/api/config.properties before it looks for /config.properties
The standard classloader will also return the first config.properties it finds on the classpath, If the application's classpath happens to have another dependency that also has config.properties in the root of the classpath, and the other dependency appears first in the classloader, then the Bitmovin version will be ignored.
Given the above, I recommend that /com/bitmovin/api/config.properties be used in preference.
bitmovin-java/src/main/java/com/bitmovin/api/BitmovinApi.java
Line 171 in fbdeffc
config.properties
is quite a generic name to exist in the root of the classpath.Unfortunately, the standard classloader, when
getResourceAsStream
is called, will search the classpath root, and adjacent to the class [0]. Empirical evidence [see test case below] suggests that it looks next to the class first e.g. with the class and package beingcom.bitmovin.api.BitmovinApi
it will look for/com/bitmovin/api/config.properties
before it looks for/config.properties
The standard classloader will also return the first
config.properties
it finds on the classpath, If the application's classpath happens to have another dependency that also hasconfig.properties
in the root of the classpath, and the other dependency appears first in the classloader, then the Bitmovin version will be ignored.Given the above, I recommend that
/com/bitmovin/api/config.properties
be used in preference.[0] https://javachannel.org/posts/how-to-access-static-resources/
Sample Testcase:
The text was updated successfully, but these errors were encountered: