6969 */
7070public class EbicsClient {
7171 private static File getRootDir () {
72- return new File (
73- System .getProperty ("user.home" ) + File .separator + "ebics" + File .separator + "client" );
72+ return new File (System .getProperty ("user.home" ), "ebics" + File .separator + "client" );
7473 }
7574
7675 static {
@@ -233,7 +232,7 @@ private void createLetters(EbicsUser user, boolean useCertificates)
233232 List <InitLetter > letters = Arrays .asList (letterManager .createA005Letter (user ),
234233 letterManager .createE002Letter (user ), letterManager .createX002Letter (user ));
235234
236- File directory = new File ( configuration .getLettersDirectory (user ) );
235+ File directory = configuration .getLettersDirectory (user );
237236 for (InitLetter letter : letters ) {
238237 try (FileOutputStream out = new FileOutputStream (new File (directory , letter .getName ()))) {
239238 letter .writeTo (out );
@@ -243,8 +242,6 @@ private void createLetters(EbicsUser user, boolean useCertificates)
243242
244243 /**
245244 * Loads a user knowing its ID
246- *
247- * @throws Exception
248245 */
249246 public User loadUser (String hostId , String partnerId , String userId ,
250247 PasswordCallback passwordCallback ) throws Exception {
@@ -282,15 +279,14 @@ public User loadUser(String hostId, String partnerId, String userId,
282279 *
283280 * @param user the user
284281 * @param product the application product
285- * @throws Exception
286282 */
287283 public void sendINIRequest (User user , Product product ) throws Exception {
288284 String userId = user .getUserId ();
289285 logger .info (messages .getString ("ini.request.send" , userId ));
290- if (user .isInitialized ()) {
291- logger .info (messages .getString ("user.already.initialized" , userId ));
292- return ;
293- }
286+ // if (user.isInitialized()) {
287+ // logger.info(messages.getString("user.already.initialized", userId));
288+ // return;
289+ // }
294290 EbicsSession session = createSession (user , product );
295291 KeyManagement keyManager = new KeyManagement (session );
296292 configuration .getTraceManager ().setTraceDirectory (
@@ -312,16 +308,15 @@ public void sendINIRequest(User user, Product product) throws Exception {
312308 * the user ID.
313309 * @param product
314310 * the application product.
315- * @throws Exception
316311 */
317312 public void sendHIARequest (User user , Product product ) throws Exception {
318313 String userId = user .getUserId ();
319314 logger .info (messages .getString ("hia.request.send" , userId ));
320- if (user .isInitializedHIA ()) {
321- logger
322- .info (messages .getString ("user.already.hia.initialized" , userId ));
323- return ;
324- }
315+ // if (user.isInitializedHIA()) {
316+ // logger
317+ // .info(messages.getString("user.already.hia.initialized", userId));
318+ // return;
319+ // }
325320 EbicsSession session = createSession (user , product );
326321 KeyManagement keyManager = new KeyManagement (session );
327322 configuration .getTraceManager ().setTraceDirectory (
@@ -433,7 +428,7 @@ public void fetchFile(File file, User user, Product product, EbicsOrderType orde
433428 // don't log this exception as an error, caller can decide how to handle
434429 throw e ;
435430 } catch (Exception e ) {
436- logger .error (messages .getString ("download.file.error" ), e );
431+ logger .error ("{} {}" , messages .getString ("download.file.error" ), e . getMessage ( ), e );
437432 throw e ;
438433 }
439434 }
@@ -538,7 +533,7 @@ public static EbicsClient createEbicsClient(File rootDir, File configFile) throw
538533
539534 final Locale locale = new Locale (language , country );
540535
541- DefaultConfiguration configuration = new DefaultConfiguration (rootDir . getAbsolutePath () ,
536+ DefaultConfiguration configuration = new DefaultConfiguration (rootDir ,
542537 properties .properties ) {
543538
544539 @ Override
@@ -653,7 +648,7 @@ public static void main(String[] args) throws Exception {
653648 String outputFileValue = cmd .getOptionValue ("o" );
654649 String inputFileValue = cmd .getOptionValue ("i" );
655650
656- List <? extends EbicsOrderType > fetchFileOrders = Arrays . asList (OrderType .STA , OrderType .VMK ,
651+ var fetchFileOrders = List . of (OrderType .STA , OrderType .VMK ,
657652 OrderType .C52 , OrderType .C53 , OrderType .C54 ,
658653 OrderType .ZDF , OrderType .ZB6 , OrderType .PTK , OrderType .HAC , OrderType .Z01 );
659654
@@ -665,7 +660,7 @@ public static void main(String[] args) throws Exception {
665660 }
666661 }
667662
668- List <? extends EbicsOrderType > sendFileOrders = Arrays . asList (OrderType .XKD , OrderType .FUL , OrderType .XCT ,
663+ var sendFileOrders = List . of (OrderType .XKD , OrderType .FUL , OrderType .XCT ,
669664 OrderType .XE2 , OrderType .CCT );
670665 for (EbicsOrderType type : sendFileOrders ) {
671666 if (hasOption (cmd , type )) {
0 commit comments