예제 #1
0
  /**
   * @return
   * @param trustManager der Trustmanager mit den Zertifikaten.
   */
  private static GenericIterator init(X509TrustManager trustManager) {
    try {
      X509Certificate[] list = trustManager.getAcceptedIssuers();
      List<CertObject> al = new ArrayList<CertObject>();
      for (int i = 0; i < list.length; ++i) {
        al.add(new CertObject(list[i]));
      }

      if (trustManager == Application.getSSLFactory().getTrustManager()) {
        // System-Zertifikat noch hinzufuegen
        al.add(new CertObject(Application.getSSLFactory().getSystemCertificate()));
      }
      Collections.sort(al);
      return PseudoIterator.fromArray(al.toArray(new CertObject[al.size()]));
    } catch (Exception e) {
      Logger.error("error while loading certificate list", e);
      try {
        return PseudoIterator.fromArray(new GenericObject[] {});
      } catch (Exception e2) {
        Logger.error("error while loading dummy list, useless", e2);
        return null;
      }
    }
  }
예제 #2
0
  /**
   * Liefert eine Liste der verfuegbaren Importer.
   *
   * @return Liste der Importer.
   * @throws Exception
   */
  private Input getImporterList() throws Exception {
    if (importerListe != null) return importerListe;

    Importer[] importers = IORegistry.getImporters();

    ArrayList l = new ArrayList();

    int size = 0;

    for (int i = 0; i < importers.length; ++i) {
      Importer imp = importers[i];
      if (imp == null) continue;
      IOFormat[] formats = imp.getIOFormats(type);
      if (formats == null || formats.length == 0) {
        Logger.debug(
            "importer "
                + imp.getName()
                + " provides no import formats for "
                + type.getName()
                + ", skipping");
        continue;
      }
      for (int j = 0; j < formats.length; ++j) {
        size++;
        l.add(new Imp(imp, formats[j]));
      }
    }

    if (size == 0) {
      importerListe = new LabelInput(i18n.tr("Keine Import-Filter verfügbar"));
      return importerListe;
    }

    Imp[] imp = (Imp[]) l.toArray(new Imp[size]);
    importerListe = new SelectInput(PseudoIterator.fromArray(imp), null);
    return importerListe;
  }
 public GenericIterator getChildren() throws RemoteException {
   if (children != null) {
     return PseudoIterator.fromArray(children.toArray(new GenericObject[children.size()]));
   }
   return null;
 }