81 lines
2.3 KiB
Java
81 lines
2.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.nre.util.TextUtil
|
|
*/
|
|
package com.tridium.sys.license.dom;
|
|
|
|
import com.tridium.sys.license.dom.VendorCertificate;
|
|
import java.io.PrintWriter;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import javax.baja.file.BDirectory;
|
|
import javax.baja.file.BIFile;
|
|
import javax.baja.nre.util.TextUtil;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class CertificateSet {
|
|
private ArrayList list;
|
|
|
|
public VendorCertificate[] getCertificates() throws Exception {
|
|
VendorCertificate[] vendorCertificateArray = new VendorCertificate[this.list.size()];
|
|
this.list.toArray(vendorCertificateArray);
|
|
return vendorCertificateArray;
|
|
}
|
|
|
|
public boolean add(VendorCertificate vendorCertificate) throws Exception {
|
|
this.list.add(vendorCertificate);
|
|
return false;
|
|
}
|
|
|
|
public boolean remove(VendorCertificate vendorCertificate) throws Exception {
|
|
return this.list.remove(vendorCertificate);
|
|
}
|
|
|
|
public void clear() throws Exception {
|
|
this.list.clear();
|
|
}
|
|
|
|
public void load(BDirectory bDirectory) {
|
|
BIFile[] bIFileArray = bDirectory.listFiles();
|
|
int n = 0;
|
|
while (bIFileArray != null && n < bIFileArray.length) {
|
|
BIFile bIFile = bIFileArray[n];
|
|
if (!bIFile.isDirectory() && "certificate".equals(bIFile.getExtension())) {
|
|
try {
|
|
this.add(VendorCertificate.make(bIFile));
|
|
}
|
|
catch (Exception exception) {
|
|
System.out.println("ERROR: Cannot read \"" + bIFile + '\"');
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
++n;
|
|
}
|
|
}
|
|
|
|
public void dump() throws Exception {
|
|
this.dump(new PrintWriter(System.out));
|
|
}
|
|
|
|
public void dump(PrintWriter printWriter) throws Exception {
|
|
printWriter.println(TextUtil.getClassName(this.getClass()));
|
|
Iterator iterator = this.list.iterator();
|
|
while (iterator.hasNext()) {
|
|
((VendorCertificate)iterator.next()).dump(printWriter);
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.list = new ArrayList();
|
|
}
|
|
|
|
public CertificateSet() {
|
|
this.this();
|
|
}
|
|
}
|
|
|