|
69 | 69 | * |
70 | 70 | */ |
71 | 71 | public class EbicsClient { |
| 72 | + /** |
| 73 | + * The workspace holding ebics.txt, the user keys and the order numbers. |
| 74 | + * |
| 75 | + * <p>Overridable through EBICS_ROOT_DIR, the same variable {@link |
| 76 | + * ParameterizedEbicsClientLauncher} uses, so that a second access (a test bank, a second |
| 77 | + * agreement) can be initialized without writing into the workspace of the first one. The keys |
| 78 | + * are not the only thing at stake: quitting saves the incremented order number, which the bank |
| 79 | + * counts. |
| 80 | + */ |
72 | 81 | private static File getRootDir() { |
| 82 | + String configured = System.getenv("EBICS_ROOT_DIR"); |
| 83 | + if (configured != null && !configured.isBlank()) { |
| 84 | + return new File(configured.trim()); |
| 85 | + } |
73 | 86 | return new File(System.getProperty("user.home"), "ebics" + File.separator + "client"); |
74 | 87 | } |
75 | 88 |
|
@@ -417,6 +430,18 @@ public void fetchFile(File file, User user, Product product, EbicsOrderType orde |
417 | 430 | fetchFile(file, user, product, orderType, null, isTest); |
418 | 431 | } |
419 | 432 |
|
| 433 | + /** |
| 434 | + * Downloads a file for the default user, with EBICS 3.0 service parameters. |
| 435 | + * |
| 436 | + * <p>The counterpart of {@link #sendFile(File, EbicsOrderType, EbicsUploadParams)}: callers |
| 437 | + * that use the default user have no other way to reach the BTD path, since the default |
| 438 | + * product is not exposed. |
| 439 | + */ |
| 440 | + public void fetchFile(File file, EbicsOrderType orderType, EbicsDownloadParams downloadParams) |
| 441 | + throws IOException, EbicsException { |
| 442 | + fetchFile(file, defaultUser, defaultProduct, orderType, downloadParams, false); |
| 443 | + } |
| 444 | + |
420 | 445 | /** |
421 | 446 | * Downloads a file from the bank. |
422 | 447 | * |
|
0 commit comments