2626import java .io .ObjectInputStream ;
2727import java .net .URL ;
2828import java .security .GeneralSecurityException ;
29- import java .util .Arrays ;
3029import java .util .Date ;
3130import java .util .HashMap ;
3231import java .util .List ;
5352import org .kopi .ebics .interfaces .PasswordCallback ;
5453import org .kopi .ebics .io .IOUtils ;
5554import org .kopi .ebics .messages .Messages ;
56- import org .kopi .ebics .schema .h003 .OrderAttributeType ;
5755import org .kopi .ebics .session .DefaultConfiguration ;
5856import org .kopi .ebics .session .EbicsSession ;
5957import org .kopi .ebics .session .OrderType ;
@@ -73,10 +71,6 @@ private static File getRootDir() {
7371 return new File (System .getProperty ("user.home" ), "ebics" + File .separator + "client" );
7472 }
7573
76- static {
77- // this is for the logging config
78- System .setProperty ("ebicsBasePath" , getRootDir ().getAbsolutePath ());
79- }
8074 private static final Logger log = LoggerFactory .getLogger (EbicsClient .class );
8175
8276 private final Configuration configuration ;
@@ -230,7 +224,7 @@ private void createLetters(EbicsUser user, boolean useCertificates)
230224 throws GeneralSecurityException , IOException , EbicsException {
231225 user .getPartner ().getBank ().setUseCertificate (useCertificates );
232226 LetterManager letterManager = configuration .getLetterManager ();
233- List <InitLetter > letters = Arrays . asList (letterManager .createA005Letter (user ),
227+ List <InitLetter > letters = List . of (letterManager .createA005Letter (user ),
234228 letterManager .createE002Letter (user ), letterManager .createX002Letter (user ));
235229
236230 File directory = configuration .getLettersDirectory (user );
@@ -390,15 +384,14 @@ public void revokeSubscriber(User user, Product product) throws Exception {
390384 */
391385 public void sendFile (File file , User user , Product product , EbicsOrderType orderType ) throws Exception {
392386 EbicsSession session = createSession (user , product );
393- OrderAttributeType .Enum orderAttribute = OrderAttributeType .OZHNN ;
394387
395388 FileTransfer transferManager = new FileTransfer (session );
396389
397390 configuration .getTraceManager ().setTraceDirectory (
398391 configuration .getTransferTraceDirectory (user ));
399392
400393 try {
401- transferManager .sendFile (IOUtils .getFileContent (file ), orderType , orderAttribute );
394+ transferManager .sendFile (IOUtils .getFileContent (file ), orderType );
402395 } catch (IOException | EbicsException e ) {
403396 log
404397 .error (messages .getString ("upload.file.error" , file .getAbsolutePath ()), e );
@@ -411,7 +404,7 @@ public void sendFile(File file, EbicsOrderType orderType) throws Exception {
411404 }
412405
413406 public void fetchFile (File file , User user , Product product , EbicsOrderType orderType ,
414- boolean isTest , Date start , Date end ) throws IOException , EbicsException {
407+ boolean isTest ) throws IOException , EbicsException {
415408 FileTransfer transferManager ;
416409 EbicsSession session = createSession (user , product );
417410 session .addSessionParam ("FORMAT" , "pain.xxx.cfonb160.dct" );
@@ -424,7 +417,7 @@ public void fetchFile(File file, User user, Product product, EbicsOrderType orde
424417 configuration .getTransferTraceDirectory (user ));
425418
426419 try {
427- transferManager .fetchFile (orderType , start , end , file );
420+ transferManager .fetchFile (orderType , file );
428421 } catch (NoDownloadDataAvailableException e ) {
429422 // don't log this exception as an error, caller can decide how to handle
430423 throw e ;
@@ -436,7 +429,7 @@ public void fetchFile(File file, User user, Product product, EbicsOrderType orde
436429
437430 public void fetchFile (File file , EbicsOrderType orderType , Date start , Date end ) throws IOException ,
438431 EbicsException {
439- fetchFile (file , defaultUser , defaultProduct , orderType , false , start , end );
432+ fetchFile (file , defaultUser , defaultProduct , orderType , false );
440433 }
441434
442435 /**
@@ -657,7 +650,7 @@ public static void main(String[] args) throws Exception {
657650 for (EbicsOrderType type : fetchFileOrders ) {
658651 if (hasOption (cmd , type )) {
659652 client .fetchFile (getOutputFile (outputFileValue ), client .defaultUser ,
660- client .defaultProduct , type , false , null , null );
653+ client .defaultProduct , type , false );
661654 break ;
662655 }
663656 }
0 commit comments