2026-03-17 13:31:18 -07:00

182 lines
5.9 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.file.BDataFile
* javax.baja.file.BIFileStore
* javax.baja.nre.util.Array
* javax.baja.nre.util.IFilter
* javax.baja.sys.BIcon
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.license;
import com.tridium.sys.license.dom.VendorLicense;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import javax.baja.file.BDataFile;
import javax.baja.file.BIFileStore;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.IFilter;
import javax.baja.sys.BIcon;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BLicenseArchiveFile
extends BDataFile {
private static final BIcon icon = BIcon.std((String)"file.png");
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$license$BLicenseArchiveFile;
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorLicense;
public VendorLicense[] getLicenses() throws Exception {
return this.getLicenses(new IFilter(){
public final boolean accept(Object object) {
return true;
}
});
}
public VendorLicense[] getLicenses(final String string) throws Exception {
return this.getLicenses(new IFilter(){
public final boolean accept(Object object) {
String string2 = (String)object;
return string2.startsWith("licenses/" + string + '/');
}
});
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void writeLicenses(VendorLicense[] vendorLicenseArray) throws Exception {
OutputStream outputStream = this.getOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
try {
int n = 0;
while (n < vendorLicenseArray.length) {
VendorLicense vendorLicense = vendorLicenseArray[n];
zipOutputStream.putNextEntry(new ZipEntry("licenses/" + vendorLicense.getHostId() + '/' + vendorLicense.getLicenseName() + ".license"));
vendorLicense.save((OutputStream)zipOutputStream, false);
zipOutputStream.closeEntry();
++n;
}
}
catch (Throwable throwable) {
Object var5_7 = null;
try {
zipOutputStream.close();
throw throwable;
}
catch (Exception exception) {}
throw throwable;
}
{
Object var5_8 = null;
}
try {}
catch (Exception exception) {
return;
}
zipOutputStream.close();
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
private final VendorLicense[] getLicenses(IFilter iFilter) throws Exception {
Class clazz = class$com$tridium$sys$license$dom$VendorLicense;
if (clazz == null) {
clazz = class$com$tridium$sys$license$dom$VendorLicense = BLicenseArchiveFile.class("[Lcom.tridium.sys.license.dom.VendorLicense;", false);
}
Array array = new Array(clazz);
ZipInputStream zipInputStream = new ZipInputStream(this.getInputStream());
try {
ZipEntry zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
if (iFilter.accept((Object)zipEntry.getName())) {
VendorLicense vendorLicense = VendorLicense.make((String)this.getFileName(), (InputStream)zipInputStream, (boolean)false);
array.add((Object)vendorLicense);
}
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
}
}
catch (Throwable throwable) {
Object var5_7 = null;
try {
zipInputStream.close();
throw throwable;
}
catch (Exception exception) {}
throw throwable;
}
{
Object var5_8 = null;
}
try {}
catch (Exception exception) {
return (VendorLicense[])array.trim();
}
zipInputStream.close();
return (VendorLicense[])array.trim();
}
public String getMimeType() {
return "application/x-baja-license-archive";
}
public BIcon getIcon() {
return icon;
}
public Type getType() {
return TYPE;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BLicenseArchiveFile(BIFileStore bIFileStore) {
super(bIFileStore);
}
public BLicenseArchiveFile() {
}
static {
Class clazz = class$com$tridium$platform$license$BLicenseArchiveFile;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BLicenseArchiveFile = BLicenseArchiveFile.class("[Lcom.tridium.platform.license.BLicenseArchiveFile;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}