Package de.willuhn.jameica.system

Examples of de.willuhn.jameica.system.Settings


   */
  protected static String getRDHLib() throws ApplicationException
  {
    AbstractPlugin p    = Application.getPluginLoader().getPlugin(HBCI.class);
    PluginResources res = p.getResources();
    Settings settings   = res.getSettings();
    Manifest mf         = p.getManifest();

    String file = null;
 
    switch (Application.getPlatform().getOS())
    {
      case Platform.OS_LINUX:
        file = settings.getString("sizrdh.nativelib","libhbci4java-sizrdh-linux-gcc3.so");
        break;
      case Platform.OS_WINDOWS:
        file = settings.getString("sizrdh.nativelib","hbci4java-sizrdh-win32.dll");;
        break;
    }
    if (file == null)
      throw new ApplicationException(res.getI18N().tr("SizRDH-Schl�sseldisketten werden f�r Ihr Betriebssystem nicht von Hibiscus unterst�tzt"));

View Full Code Here


    this.type = type;
   
    this.setTitle(i18n.tr("Daten-Import"));
    this.setSize(WINDOW_WIDTH,SWT.DEFAULT);

    settings = new Settings(this.getClass());
    settings.setStoreWhenRead(true);
  }
View Full Code Here

    File newKey = new File(newFile);
    if (!newKey.getParentFile().canWrite())
      throw new ApplicationException(i18n.tr("Keine Schreibberechtigung"));

    // BUGZILLA 289
    Settings settings = res.getSettings();
    HBCICallback callback = plugin.getHBCICallback();

    try
    {
      ////////////////////////////////////////////////////////////////////////
      // Erst laden wir den SizRDH-Schluessel
      Logger.info("loading sizrdh key");
      if (callback != null && (callback instanceof HBCICallbackSWT))
        ((HBCICallbackSWT)callback).setCurrentHandle(new PassportHandleImpl());
     
      // Abfrage des Passwortes erzwingen
      settings.setAttribute("hbcicallback.askpassphrase.force",true);
     
      HBCIUtils.setParam("client.passport.SIZRDHFile.filename",file.getAbsolutePath());
      HBCIUtils.setParam("client.passport.SIZRDHFile.libname",getRDHLib());
      HBCIUtils.setParam("client.passport.SIZRDHFile.init","0");
      HBCIPassportInternal source = (HBCIPassportInternal) AbstractHBCIPassport.getInstance("SIZRDHFile");
      ////////////////////////////////////////////////////////////////////////

      ////////////////////////////////////////////////////////////////////////
      // Jetzt erzeugen wir einen im HBCI4Java-Format und kopieren die Daten
      Logger.info("converting into hbci4java format");
      HBCIUtils.setParam("client.passport.default","RDHNew");
      HBCIUtils.setParam("client.passport.RDHNew.filename",newKey.getAbsolutePath());
      HBCIUtils.setParam("client.passport.RDHNew.init","0");
      HBCIPassportInternal target = (HBCIPassportInternal) AbstractHBCIPassport.getInstance("RDHNew");

      target.setCountry(source.getCountry());
      target.setBLZ(source.getBLZ());
      target.setHost(source.getHost());
      target.setPort(source.getPort());
      target.setUserId(source.getUserId());
      target.setCustomerId(source.getCustomerId());
      target.setSysId(source.getSysId());
      target.setSigId(source.getSigId());
      target.setHBCIVersion(source.getHBCIVersion());
      target.setBPD(source.getBPD());
      target.setUPD(source.getUPD());
         
      ((HBCIPassportRDHNew)target).setInstSigKey(source.getInstSigKey());
      ((HBCIPassportRDHNew)target).setInstEncKey(source.getInstEncKey());
      ((HBCIPassportRDHNew)target).setMyPublicSigKey(source.getMyPublicSigKey());
      ((HBCIPassportRDHNew)target).setMyPrivateSigKey(source.getMyPrivateSigKey());
      ((HBCIPassportRDHNew)target).setMyPublicEncKey(source.getMyPublicEncKey());
      ((HBCIPassportRDHNew)target).setMyPrivateEncKey(source.getMyPrivateEncKey());
         
      target.saveChanges();
      target.close();
      source.close();
      ////////////////////////////////////////////////////////////////////////
      RDHKeyImpl key = new RDHKeyImpl(newKey);
      key.setFormat(new HBCI4JavaFormat()); // wir tragen nicht uns selbst ein - da wir den ja ins HBCI4Java-Format konvertiert haben
      return key;
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (OperationCanceledException oce)
    {
      throw oce;
    }
    catch (Exception e)
    {
      OperationCanceledException oce = (OperationCanceledException) HBCIProperties.getCause(e,OperationCanceledException.class);
      if (oce != null)
        throw oce;
       
      ApplicationException ae = (ApplicationException) HBCIProperties.getCause(e,ApplicationException.class);
      if (ae != null)
        throw ae;

      Logger.error("unable to import key " + file.getAbsolutePath(),e);
      throw new ApplicationException(i18n.tr("Schl�sseldatei kann nicht importiert werden: {0}",e.getMessage()));
    }
    finally
    {
      settings.setAttribute("hbcicallback.askpassphrase.force",false);
      if (callback != null && (callback instanceof HBCICallbackSWT))
        ((HBCICallbackSWT)callback).setCurrentHandle(null);
    }
  }
View Full Code Here

  {
    this.fields.clear();

    final int maxusage = VerwendungszweckUtil.getMaxUsageUeb(konto);

    Settings settings = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getSettings();
    int size = settings.getInt("transfertype.usagelist.size",5);
    if (orig != null && orig.length > size)
      size = orig.length;

    final ScrolledContainer container = new ScrolledContainer(parent);
    for (int i=0;i<size;++i)
View Full Code Here

TOP

Related Classes of de.willuhn.jameica.system.Settings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.