File tree Expand file tree Collapse file tree
moneta-convert/moneta-convert-ecb/src/main/java/org/javamoney/moneta/convert/ecb
moneta-core/src/main/java/org/javamoney/moneta/spi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ protected LoadDataInformation getDefaultLoadData() {
7171 .withResourceId (getDataId ())
7272 .withUpdatePolicy (LoaderService .UpdatePolicy .SCHEDULED )
7373 .withProperties (props )
74- .withBackupResource (getResourceFromPath (ECB_CURRENT_FALLBACK_PATH ))
74+ .withBackupResource (getResourceFromPath (ECB_CURRENT_FALLBACK_PATH , getClass () ))
7575 .withResourceLocations (URI .create (ECB_CURRENT_URL ))
7676 .withStartRemote (true )
7777 .build ();
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ protected LoadDataInformation getDefaultLoadData() {
7777 .withResourceId (getDataId ())
7878 .withUpdatePolicy (LoaderService .UpdatePolicy .SCHEDULED )
7979 .withProperties (props )
80- .withBackupResource (getResourceFromPath (ECB_HIST90_FALLBACK_PATH ))
80+ .withBackupResource (getResourceFromPath (ECB_HIST90_FALLBACK_PATH , getClass () ))
8181 .withResourceLocations (URI .create (ECB_HIST90_URL ))
8282 .withStartRemote (true )
8383 .build ();
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ protected LoadDataInformation getDefaultLoadData() {
8282 .withResourceId (getDataId ())
8383 .withUpdatePolicy (LoaderService .UpdatePolicy .SCHEDULED )
8484 .withProperties (props )
85- .withBackupResource (getResourceFromPath (ECB_HIST_FALLBACK_PATH ))
85+ .withBackupResource (getResourceFromPath (ECB_HIST_FALLBACK_PATH , getClass () ))
8686 .withResourceLocations (URI .create (ECB_HIST_URL ))
8787 .withStartRemote (false )
8888 .build ();
@@ -96,8 +96,8 @@ protected LoadDataInformation getDefaultLoadData() {
9696// .withProperties(Map.of("period", "24:00",
9797// "delay", "01:00",
9898// "at", "07:00"))
99- // .withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist.xml" ))
100- // .withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml" ))
99+ // .withBackupResource(getResourceFromPath(ECB_HIST_FALLBACK_PATH, getClass() ))
100+ // .withResourceLocations(URI.create(ECB_HIST_URL ))
101101// .withStartRemote(true)
102102// .build();
103103// }
Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ public final class Defaults {
2020 private Defaults () {}
2121
2222 public static final String ECB_CURRENT_URL = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" ;
23- public static final String ECB_CURRENT_FALLBACK_PATH = "org/javamoney/moneta/convert/ecb/defaults/eurofxref-daily.xml" ;
23+ public static final String ECB_CURRENT_FALLBACK_PATH = "/ org/javamoney/moneta/convert/ecb/defaults/eurofxref-daily.xml" ;
2424
2525 public static final String ECB_HIST90_URL = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml" ;
26- public static final String ECB_HIST90_FALLBACK_PATH = "org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist-90d.xml" ;
26+ public static final String ECB_HIST90_FALLBACK_PATH = "/ org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist-90d.xml" ;
2727
2828 public static final String ECB_HIST_URL = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml" ;
29- public static final String ECB_HIST_FALLBACK_PATH = "org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist.xml" ;
29+ public static final String ECB_HIST_FALLBACK_PATH = "/ org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist.xml" ;
3030}
Original file line number Diff line number Diff line change @@ -182,10 +182,11 @@ protected LocalDate[] getQueryDates(ConversionQuery query) {
182182 * Return a URI from the given location.
183183 *
184184 * @param path the given location.
185+ * @param clazz the class to use for path resolution
185186 * @return the URL resource, or null.
186187 */
187- protected URI getResourceFromPath (String path ) {
188- final URL url = getClass () .getResource (path );
188+ protected URI getResourceFromPath (String path , Class <?> clazz ) {
189+ final URL url = clazz .getResource (path );
189190 URI resource = null ;
190191 try {
191192 resource = url .toURI ();
You can’t perform that action at this time.
0 commit comments