link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,117 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.FilePath
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.install.installable;
import com.tridium.install.BDaemonPlatform;
import com.tridium.install.installable.BInstallable;
import com.tridium.platform.daemon.file.StoreCache;
import com.tridium.platform.daemon.message.ByteArrayFileTransferElement;
import com.tridium.platform.daemon.message.FileTransferMessageElement;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import javax.baja.file.FilePath;
import javax.baja.platform.ICancelHint;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BByteInstallable
extends BInstallable {
public static final Property destinationDirPathBody = BByteInstallable.newProperty((int)0, (String)"!", null);
public static final Property contents = BByteInstallable.newProperty((int)0, (String)"", null);
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$install$installable$BByteInstallable;
public String getDestinationDirPathBody() {
return this.getString(destinationDirPathBody);
}
public void setDestinationDirPathBody(String string) {
this.setString(destinationDirPathBody, string, null);
}
public String getContents() {
return this.getString(contents);
}
public void setContents(String string) {
this.setString(contents, string, null);
}
public Type getType() {
return TYPE;
}
public void close() {
}
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
return new FileTransferMessageElement[]{new ByteArrayFileTransferElement(new FilePath(this.getDestinationDirPathBody()), this.getContents().getBytes(), bDaemonPlatform.getDaemonSession().getFileSpace())};
}
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
return 0L;
}
public boolean equivalent(Object object) {
if (object instanceof BByteInstallable) {
BByteInstallable bByteInstallable = (BByteInstallable)object;
boolean bl = false;
if (bByteInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bByteInstallable.getContents().equals(this.getContents())) {
bl = true;
}
return bl;
}
return false;
}
public BInstallable makeLocalInstance() {
return this;
}
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 BByteInstallable() {
}
public BByteInstallable(FilePath filePath, byte[] byArray) {
this.setDestinationDirPathBody(filePath.getBody());
this.setContents(new String(byArray));
this.setInstallableName(filePath.getBody());
}
public BByteInstallable(FilePath filePath, String string) {
this.setDestinationDirPathBody(filePath.getBody());
this.setContents(string);
this.setInstallableName(filePath.getBody());
}
static {
Class clazz = class$com$tridium$install$installable$BByteInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BByteInstallable = BByteInstallable.class("[Lcom.tridium.install.installable.BByteInstallable;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,127 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.naming.BOrd
* javax.baja.naming.OrdQuery
* javax.baja.sys.BIcon
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.install.installable;
import com.tridium.install.BDaemonPlatform;
import com.tridium.install.installable.BInstallable;
import com.tridium.platform.daemon.file.StoreCache;
import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement;
import com.tridium.platform.daemon.message.FileTransferMessageElement;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.platform.ICancelHint;
import javax.baja.sys.BIcon;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BDeleteFileInstallable
extends BInstallable {
public static final Type TYPE;
private static final BIcon icon;
private boolean localInstance;
static /* synthetic */ Class class$com$tridium$install$installable$BDeleteFileInstallable;
public Type getType() {
return TYPE;
}
public void close() {
}
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
if (!this.localInstance) {
throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable");
}
if (this.getInstallableFileOrd().isNull()) {
return new FileTransferMessageElement[0];
}
OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse();
return new FileTransferMessageElement[]{new DeleteFileTransferMessageElement((FilePath)ordQueryArray[ordQueryArray.length - 1], bDaemonPlatform.getDaemonSession().getFileSpace())};
}
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
if (!this.localInstance) {
throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable");
}
return 0L;
}
public BInstallable makeLocalInstance() {
if (this.localInstance) {
return this;
}
try {
OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse();
return new BDeleteFileInstallable((FilePath)ordQueryArray[ordQueryArray.length - 1]);
}
catch (RuntimeException runtimeException) {
System.out.println("ord: " + this.getInstallableFileOrd());
throw runtimeException;
}
}
public BIcon getIcon() {
return icon;
}
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());
}
}
private final /* synthetic */ void this() {
this.localInstance = false;
}
public BDeleteFileInstallable() {
this.this();
}
public BDeleteFileInstallable(BIFile bIFile) {
this.this();
this.setInstallableFileOrd(bIFile.getOrdInSession());
this.localInstance = true;
this.setInstallableName(bIFile.getFilePath().getBody());
}
public BDeleteFileInstallable(FilePath filePath) {
this.this();
this.setInstallableFileOrd(BOrd.make((OrdQuery)filePath));
this.localInstance = true;
this.setInstallableName(filePath.getBody());
}
static {
Class clazz = class$com$tridium$install$installable$BDeleteFileInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BDeleteFileInstallable = BDeleteFileInstallable.class("[Lcom.tridium.install.installable.BDeleteFileInstallable;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"delete.png");
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,79 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BDataFile
* javax.baja.file.BIFile
* javax.baja.file.BIFileStore
* javax.baja.sys.BIcon
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.install.installable;
import com.tridium.install.installable.BDistribution;
import javax.baja.file.BDataFile;
import javax.baja.file.BIFile;
import javax.baja.file.BIFileStore;
import javax.baja.sys.BIcon;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BDistributionFile
extends BDataFile {
private static final BIcon icon = BIcon.std((String)"modules.png");
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$install$installable$BDistributionFile;
public BDistribution makeDistribution() {
return this.makeDistribution(true);
}
public BDistribution makeDistribution(boolean bl) {
return new BDistribution((BIFile)this, bl);
}
public String getMimeType() {
return "application/x-baja-dist";
}
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 BDistributionFile(BIFileStore bIFileStore) {
super(bIFileStore);
}
public BDistributionFile() {
}
static {
Class clazz = class$com$tridium$install$installable$BDistributionFile;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BDistributionFile = BDistributionFile.class("[Lcom.tridium.install.installable.BDistributionFile;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,220 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BDirectory
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.file.FileUtil
* javax.baja.naming.UnresolvedException
* javax.baja.registry.TypeInfo
* javax.baja.sys.BIcon
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.install.installable;
import com.tridium.install.BDaemonPlatform;
import com.tridium.install.installable.BInstallable;
import com.tridium.platform.daemon.file.BDaemonFileSpace;
import com.tridium.platform.daemon.file.StoreCache;
import com.tridium.platform.daemon.message.FileFileTransferElement;
import com.tridium.platform.daemon.message.FileTransferMessageElement;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import java.util.ArrayList;
import java.util.List;
import javax.baja.file.BDirectory;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.file.FileUtil;
import javax.baja.naming.UnresolvedException;
import javax.baja.platform.ICancelHint;
import javax.baja.registry.TypeInfo;
import javax.baja.sys.BIcon;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BFileInstallable
extends BInstallable {
public static final Property destinationFileName = BFileInstallable.newProperty((int)0, (String)"", null);
public static final Property destinationDirPathBody = BFileInstallable.newProperty((int)0, (String)"!", null);
public static final Type TYPE;
private static final BIcon icon;
private BIFile file;
private boolean localInstance;
static /* synthetic */ Class class$com$tridium$install$installable$BFileInstallable;
public String getDestinationFileName() {
return this.getString(destinationFileName);
}
public void setDestinationFileName(String string) {
this.setString(destinationFileName, string, null);
}
public String getDestinationDirPathBody() {
return this.getString(destinationDirPathBody);
}
public void setDestinationDirPathBody(String string) {
this.setString(destinationDirPathBody, string, null);
}
public Type getType() {
return TYPE;
}
public void close() {
}
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
if (!this.localInstance) {
throw new IllegalStateException("illegal call on proxy instance of BFileInstallable");
}
ArrayList arrayList = new ArrayList();
String string = this.getDestinationFileName();
if (string.length() == 0) {
string = this.file.getFileName();
}
this.addFiles(arrayList, this.file, string, new FilePath(this.getDestinationDirPathBody()), bDaemonPlatform.getDaemonSession().getFileSpace(), iCancelHint);
FileTransferMessageElement[] fileTransferMessageElementArray = new FileTransferMessageElement[arrayList.size()];
arrayList.toArray(fileTransferMessageElementArray);
return fileTransferMessageElementArray;
}
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
if (!this.localInstance) {
throw new IllegalStateException("illegal call on proxy instance of BFileInstallable");
}
return 0L;
}
public BInstallable makeLocalInstance() {
if (this.localInstance) {
return this;
}
try {
return new BFileInstallable((BIFile)this.getInstallableFileOrd().get(), this.getDestinationFileName(), new FilePath(this.getDestinationDirPathBody()));
}
catch (UnresolvedException unresolvedException) {
return null;
}
catch (RuntimeException runtimeException) {
System.out.println("ord: " + this.getInstallableFileOrd());
throw runtimeException;
}
}
public boolean equivalent(Object object) {
if (object instanceof BFileInstallable) {
BFileInstallable bFileInstallable = (BFileInstallable)object;
boolean bl = false;
if (super.equivalent(bFileInstallable) && bFileInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bFileInstallable.getDestinationFileName().equals(this.getDestinationFileName())) {
bl = true;
}
return bl;
}
return false;
}
private final void addFiles(List list, BIFile bIFile, String string, FilePath filePath, BDaemonFileSpace bDaemonFileSpace, ICancelHint iCancelHint) {
if (bIFile instanceof BDirectory) {
BIFile[] bIFileArray = ((BDirectory)bIFile).listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (iCancelHint != null && iCancelHint.isCanceled()) {
throw new ICancelHint.CanceledException();
}
this.addFiles(list, bIFileArray[n], bIFileArray[n].getFileName(), filePath.merge(string), bDaemonFileSpace, iCancelHint);
++n;
}
} else {
list.add(new FileFileTransferElement(filePath.merge(string), bIFile, bDaemonFileSpace));
}
}
public BIcon getIcon() {
try {
String string = FileUtil.getExtension((String)this.getInstallableFileName());
if (string != null && string.length() > 0) {
TypeInfo typeInfo = Sys.getRegistry().getFileTypeForExtension(string);
BObject bObject = typeInfo.getInstance();
return bObject.getIcon();
}
}
catch (Exception exception) {}
return icon;
}
public String toString(Context context) {
return this.getInstallableName();
}
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());
}
}
private final /* synthetic */ void this() {
this.localInstance = false;
}
public BFileInstallable() {
this.this();
}
public BFileInstallable(BIFile bIFile, FilePath filePath) {
this(bIFile);
this.setDestinationDirPathBody(filePath.getBody());
this.setInstallableName(filePath.merge(bIFile.getFileName()).getBody());
}
public BFileInstallable(BIFile bIFile, String string, FilePath filePath) {
this(bIFile);
this.setDestinationDirPathBody(filePath.getBody());
this.setDestinationFileName(string);
this.setInstallableName(filePath.merge(string).getBody());
}
public BFileInstallable(BIFile bIFile) {
this.this();
this.setDestinationFileName(bIFile.getFileName());
this.setInstallableName(bIFile.getFileName());
this.setDescription(bIFile.getFileName());
this.setInstallableFileProperties(bIFile);
if (bIFile.isDirectory()) {
this.setDestinationDirPathBody(bIFile.getFilePath().getBody());
} else {
this.setDestinationDirPathBody(bIFile.getFilePath().getParent().getBody());
}
this.file = bIFile;
this.localInstance = true;
}
static {
Class clazz = class$com$tridium$install$installable$BFileInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BFileInstallable = BFileInstallable.class("[Lcom.tridium.install.installable.BFileInstallable;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"file.png");
}
}
@@ -0,0 +1,507 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BIDirectory
* javax.baja.file.BIFile
* javax.baja.file.BLocalFileStore
* javax.baja.naming.BOrd
* javax.baja.naming.SlotPath
* javax.baja.nre.util.Array
* javax.baja.sys.BComponent
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.SlotCursor
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.timezone.BTimeZone
*/
package com.tridium.install.installable;
import com.tridium.install.BDaemonPlatform;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.PartSpec;
import com.tridium.install.installable.BDistribution;
import com.tridium.install.installable.BModuleInstallable;
import com.tridium.install.installable.LocalInstallableRegistry;
import com.tridium.install.part.BArchPart;
import com.tridium.install.part.BGenericPart;
import com.tridium.install.part.BModelPart;
import com.tridium.install.part.BOsPart;
import com.tridium.install.part.BPart;
import com.tridium.platform.daemon.BModuleContent;
import com.tridium.platform.daemon.file.StoreCache;
import com.tridium.platform.daemon.message.FileTransferMessageElement;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import java.io.File;
import java.util.TreeMap;
import javax.baja.file.BIDirectory;
import javax.baja.file.BIFile;
import javax.baja.file.BLocalFileStore;
import javax.baja.naming.BOrd;
import javax.baja.naming.SlotPath;
import javax.baja.nre.util.Array;
import javax.baja.platform.ICancelHint;
import javax.baja.sys.BComponent;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.timezone.BTimeZone;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BInstallable
extends BComponent
implements Comparable {
public static final Property parts = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
public static final Property dependencies = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
public static final Property exclusions = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
public static final Property installableName = BInstallable.newProperty((int)1, (String)"unknown", null);
public static final Property description = BInstallable.newProperty((int)1, (String)"", null);
public static final Property version = BInstallable.newProperty((int)1, (BValue)BVersion.makeZero(), null);
public static final Property installableFileOrd = BInstallable.newProperty((int)1, (BValue)BOrd.NULL, null);
public static final Property installableFileName = BInstallable.newProperty((int)1, (String)"unknown ", null);
public static final Property installableFileSize = BInstallable.newProperty((int)1, (int)-1, null);
public static final Property updateModuleContent = BInstallable.newProperty((int)1, (boolean)false, null);
public static final Property newModuleContent = BInstallable.newProperty((int)1, (BValue)BModuleContent.doc, null);
public static final Property newOsTimeZone = BInstallable.newProperty((int)1, (BValue)BTimeZone.NULL, null);
public static final Property isValid = BInstallable.newProperty((int)1, (boolean)true, null);
public static final Property isStandalone = BInstallable.newProperty((int)1, (boolean)false, null);
public static final Property isInstallable = BInstallable.newProperty((int)1, (boolean)true, null);
public static final Type TYPE;
public static final long FLAG_NO_RUNNING_APP = 1L;
public static final long FLAG_NO_RUNNING_STATION = 2L;
public static final long FLAG_UPDATE_RUNNING_STATION = 4L;
public static final long FLAG_REBOOT = 65536L;
public static final long FLAG_OS_INSTALL = 131072L;
public static final long FLAG_UPDATE_DAEMON = 262144L;
public static final long FLAG_UPDATE_TCPIP = 524288L;
public static final long FLAG_UPDATE_CONTENT = 0x100000L;
public static final long FLAG_UPDATE_OS_TZ = 0x200000L;
private PartSpec partSpec;
static /* synthetic */ Class class$com$tridium$install$installable$BInstallable;
static /* synthetic */ Class class$com$tridium$install$part$BPart;
static /* synthetic */ Class class$com$tridium$install$BDependency;
public BVector getParts() {
return (BVector)this.get(parts);
}
public void setParts(BVector bVector) {
this.set(parts, (BValue)bVector, null);
}
public BVector getDependencies() {
return (BVector)this.get(dependencies);
}
public void setDependencies(BVector bVector) {
this.set(dependencies, (BValue)bVector, null);
}
public BVector getExclusions() {
return (BVector)this.get(exclusions);
}
public void setExclusions(BVector bVector) {
this.set(exclusions, (BValue)bVector, null);
}
public String getInstallableName() {
return this.getString(installableName);
}
public void setInstallableName(String string) {
this.setString(installableName, string, null);
}
public String getDescription() {
return this.getString(description);
}
public void setDescription(String string) {
this.setString(description, string, null);
}
public BVersion getVersion() {
return (BVersion)this.get(version);
}
public void setVersion(BVersion bVersion) {
this.set(version, (BValue)bVersion, null);
}
public BOrd getInstallableFileOrd() {
return (BOrd)this.get(installableFileOrd);
}
public void setInstallableFileOrd(BOrd bOrd) {
this.set(installableFileOrd, (BValue)bOrd, null);
}
public String getInstallableFileName() {
return this.getString(installableFileName);
}
public void setInstallableFileName(String string) {
this.setString(installableFileName, string, null);
}
public long getInstallableFileSize() {
return this.getLong(installableFileSize);
}
public void setInstallableFileSize(long l) {
this.setLong(installableFileSize, l, null);
}
public boolean getUpdateModuleContent() {
return this.getBoolean(updateModuleContent);
}
public void setUpdateModuleContent(boolean bl) {
this.setBoolean(updateModuleContent, bl, null);
}
public BModuleContent getNewModuleContent() {
return (BModuleContent)this.get(newModuleContent);
}
public void setNewModuleContent(BModuleContent bModuleContent) {
this.set(newModuleContent, (BValue)bModuleContent, null);
}
public BTimeZone getNewOsTimeZone() {
return (BTimeZone)this.get(newOsTimeZone);
}
public void setNewOsTimeZone(BTimeZone bTimeZone) {
this.set(newOsTimeZone, (BValue)bTimeZone, null);
}
public boolean getIsValid() {
return this.getBoolean(isValid);
}
public void setIsValid(boolean bl) {
this.setBoolean(isValid, bl, null);
}
public boolean getIsStandalone() {
return this.getBoolean(isStandalone);
}
public void setIsStandalone(boolean bl) {
this.setBoolean(isStandalone, bl, null);
}
public boolean getIsInstallable() {
return this.getBoolean(isInstallable);
}
public void setIsInstallable(boolean bl) {
this.setBoolean(isInstallable, bl, null);
}
public Type getType() {
return TYPE;
}
public abstract long getProcessingFlags(BDaemonPlatform var1, DaemonSessionTaskListener var2);
public abstract FileTransferMessageElement[] getTransferElements(BDaemonPlatform var1, StoreCache var2, ICancelHint var3, DaemonSessionTaskListener var4) throws Exception;
public BInstallable makeInstallableForPart(String string) {
if (this.getParts().get(SlotPath.escape((String)string)) == null) {
return null;
}
return this;
}
public BTcpIpHostSettings getTcpIpChanges() {
return null;
}
public BPart getPart() {
SlotCursor slotCursor = this.getParts().getProperties();
Class clazz = class$com$tridium$install$part$BPart;
if (clazz == null) {
clazz = class$com$tridium$install$part$BPart = BInstallable.class("[Lcom.tridium.install.part.BPart;", false);
}
return slotCursor.next(clazz) ? (BPart)slotCursor.get() : null;
}
public PartSpec getPartSpec() {
if (this.partSpec == null) {
BPart bPart = this.getPart();
this.partSpec = bPart == null ? new PartSpec(this.getInstallableName(), this.getType()) : bPart.getPartSpec();
}
return this.partSpec;
}
public abstract void close() throws Exception;
public abstract BInstallable makeLocalInstance();
protected void setInstallableFileProperties(BIFile bIFile) {
this.setInstallableFileOrd(bIFile.getOrdInSession());
this.setInstallableFileName(bIFile.getFileName());
this.setInstallableFileSize(bIFile.getSize());
if (this.getInstallableName().equals("unknown")) {
this.setInstallableName(bIFile.getFileName());
}
}
public File getLocalInstallableFile() {
if (!this.getInstallableFileOrd().isNull()) {
try {
BIFile bIFile = (BIFile)this.getInstallableFileOrd().get();
if (bIFile != null && bIFile.getStore() instanceof BLocalFileStore) {
return ((BLocalFileStore)bIFile.getStore()).getLocalFile();
}
}
catch (Exception exception) {}
}
return null;
}
public static boolean isInstallableFile(BIFile bIFile) {
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
return false;
}
if (bIFile.getExtension().equals("dist")) {
return true;
}
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
return true;
}
return LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension()) != null;
}
public static BInstallable make(BIFile bIFile) {
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
return null;
}
if (bIFile.getExtension().equals("dist")) {
return BInstallable.make(BDistribution.TYPE, bIFile);
}
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
return BInstallable.make(BModuleInstallable.TYPE, bIFile);
}
Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension());
if (type != null) {
return BInstallable.make(type, bIFile);
}
return null;
}
public static BInstallable make(Type type, BIFile bIFile) {
BInstallable bInstallable = (BInstallable)type.getInstance();
bInstallable.setInstallableFileProperties(bIFile);
return bInstallable.makeLocalInstance();
}
public static BInstallable makeRemote(BIFile bIFile) {
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
return null;
}
if (bIFile.getExtension().equals("dist")) {
return BInstallable.makeRemote(BDistribution.TYPE, bIFile);
}
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
return BInstallable.makeRemote(BModuleInstallable.TYPE, bIFile);
}
Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension());
if (type != null) {
return BInstallable.makeRemote(type, bIFile);
}
return null;
}
public static BInstallable makeRemote(Type type, BIFile bIFile) {
BInstallable bInstallable = (BInstallable)type.getInstance();
bInstallable.setInstallableFileProperties(bIFile);
return bInstallable;
}
public final BDependency[] getAllDependencies() {
TreeMap treeMap = new TreeMap();
BDependency[] bDependencyArray = this.getDependencies().getProperties();
while (bDependencyArray.next()) {
this.updateDependencyMap(treeMap, (BDependency)bDependencyArray.get());
}
bDependencyArray = this.getParts().getProperties();
while (bDependencyArray.next()) {
BPart bPart = (BPart)bDependencyArray.get();
SlotCursor slotCursor = bPart.getDependencies().getProperties();
while (slotCursor.next()) {
this.updateDependencyMap(treeMap, (BDependency)slotCursor.get());
}
}
bDependencyArray = new BDependency[treeMap.size()];
treeMap.values().toArray(bDependencyArray);
return bDependencyArray;
}
public BDependency[] getAllExclusions() {
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
SlotCursor slotCursor = this.getExclusions().getProperties();
while (slotCursor.next()) {
array.add((Object)slotCursor.get());
}
return (BDependency[])array.trim();
}
private final void updateDependencyMap(TreeMap treeMap, BDependency bDependency) {
BDependency bDependency2 = (BDependency)((Object)treeMap.get(bDependency.getPartSpec()));
if (bDependency2 == null || bDependency.supersedes(bDependency2)) {
treeMap.put(bDependency.getPartSpec(), bDependency);
}
}
public Array getUnmetPlatformDependencies(BDaemonPlatform bDaemonPlatform) {
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
SlotCursor slotCursor = this.getDependencies().getProperties();
while (slotCursor.next()) {
BDependency bDependency = (BDependency)slotCursor.get();
Type type = bDependency.getPartType();
if (type.is(BOsPart.TYPE)) {
if (bDaemonPlatform.getOsPart().matchesName(bDependency.getPartName())) {
if (bDaemonPlatform.getOsPart().isInstallable()) continue;
array.add((Object)bDependency.newCopy());
continue;
}
if (bDaemonPlatform.meets(bDependency)) continue;
array.add((Object)bDependency.newCopy());
continue;
}
if (!type.is(BArchPart.TYPE) && !type.is(BGenericPart.TYPE) && !type.is(BModelPart.TYPE) || bDaemonPlatform.meets(bDependency)) continue;
array.add((Object)bDependency.newCopy());
}
return array;
}
public boolean equivalent(Object object) {
if (object instanceof BInstallable) {
BInstallable bInstallable = (BInstallable)object;
return bInstallable.getInstallableFileOrd().equivalent((Object)this.getInstallableFileOrd());
}
return false;
}
public int compareTo(Object object) {
if (this.equivalent(object)) {
return 0;
}
if (object instanceof BInstallable) {
BInstallable bInstallable = (BInstallable)object;
if (this.getType().equals(bInstallable.getType())) {
int n = bInstallable.getInstallableName().compareTo(this.getInstallableName());
if (n == 0) {
return this.getVersion().compareTo((Object)bInstallable.getVersion());
}
return n;
}
return this.getType().toString().compareTo(bInstallable.getType().toString());
}
return this.toString().compareTo(object.toString());
}
public final BPart getPart(String string) {
return this.getPart(string, null);
}
/*
* Unable to fully structure code
*/
public BPart getPart(String var1_1, DaemonSessionTaskListener var2_2) {
block2: {
if (!BPart.isWildcardName(var1_1)) break block2;
var3_3 = this.getParts().getProperties();
if (true) ** GOTO lbl7
do {
if ((var4_4 = (BPart)var3_3.get()).matchesName(var1_1)) {
return var4_4;
}
lbl7:
// 3 sources
if ((v0 = BInstallable.class$com$tridium$install$part$BPart) != null) continue;
v0 = BInstallable.class("[Lcom.tridium.install.part.BPart;", false);
} while (var3_3.next(v0));
return null;
}
return (BPart)this.getParts().get(SlotPath.escape((String)var1_1));
}
public void registerInstallableResources(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
}
public final boolean meets(BDependency bDependency) {
return this.meets(bDependency, null);
}
public boolean meets(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) {
BPart bPart = this.getPart(bDependency.getPartName(), daemonSessionTaskListener);
boolean bl = false;
if (bPart != null) {
bl = bPart.meets(bDependency);
}
return bl;
}
public String toString(Context context) {
String string = this.getVersion().toString(context);
if (string.trim().length() == 0) {
return this.getInstallableName();
}
return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string});
}
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());
}
}
private final /* synthetic */ void this() {
this.partSpec = null;
}
public BInstallable() {
this.this();
}
static {
Class clazz = class$com$tridium$install$installable$BInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BInstallable = BInstallable.class("[Lcom.tridium.install.installable.BInstallable;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,169 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.io.BIEncodable
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BObject
* javax.baja.sys.BStruct
* javax.baja.sys.BValue
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.BTypeSpec
* javax.baja.util.Version
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.installable.BInstallable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import javax.baja.io.BIEncodable;
import javax.baja.nre.util.TextUtil;
import javax.baja.platform.install.BVersionRelation;
import javax.baja.sys.BObject;
import javax.baja.sys.BStruct;
import javax.baja.sys.BValue;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.BTypeSpec;
import javax.baja.util.Version;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BInstallableSpec
extends BStruct
implements BIEncodable {
public static final Property installableName = BInstallableSpec.newProperty((int)1, (String)"", null);
public static final Property version = BInstallableSpec.newProperty((int)1, (BValue)new BVersion(), null);
public static final Property installableType = BInstallableSpec.newProperty((int)1, (BValue)BTypeSpec.NULL, null);
public static final Type TYPE;
public static final BInstallableSpec DEFAULT;
static /* synthetic */ Class class$com$tridium$install$installable$BInstallableSpec;
public String getInstallableName() {
return this.getString(installableName);
}
public void setInstallableName(String string) {
this.setString(installableName, string, null);
}
public BVersion getVersion() {
return (BVersion)this.get(version);
}
public void setVersion(BVersion bVersion) {
this.set(version, (BValue)bVersion, null);
}
public BTypeSpec getInstallableType() {
return (BTypeSpec)this.get(installableType);
}
public void setInstallableType(BTypeSpec bTypeSpec) {
this.set(installableType, (BValue)bTypeSpec, null);
}
public Type getType() {
return TYPE;
}
public static BInstallableSpec make(BInstallable bInstallable) {
return new BInstallableSpec(bInstallable.getInstallableName(), (BVersion)bInstallable.getVersion().newCopy(), bInstallable.getType());
}
public BDependency asDependency() {
return new BDependency(this.getInstallableName(), this.getVersion(), BVersionRelation.exact, this.getInstallableType());
}
public String toString(Context context) {
String string = this.getVersion().toString(context);
if (string.trim().length() == 0) {
return this.getInstallableName();
}
return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string});
}
public void encode(DataOutput dataOutput) throws IOException {
dataOutput.writeUTF(this.getInstallableName());
this.getVersion().encode(dataOutput);
this.getInstallableType().encode(dataOutput);
}
public BObject decode(DataInput dataInput) throws IOException {
BInstallableSpec bInstallableSpec = new BInstallableSpec();
bInstallableSpec.setInstallableName(dataInput.readUTF());
bInstallableSpec.setVersion((BVersion)BVersion.ZERO.decode(dataInput));
bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decode(dataInput));
return bInstallableSpec;
}
public String encodeToString() throws IOException {
StringBuffer stringBuffer = new StringBuffer(128);
stringBuffer.append(this.getInstallableName());
stringBuffer.append(';');
stringBuffer.append(this.getVersion().getBajaVersionString());
stringBuffer.append(';');
stringBuffer.append(this.getVersion().getVendor());
stringBuffer.append(';');
stringBuffer.append(this.getVersion().getVendorVersionString());
stringBuffer.append(';');
stringBuffer.append(this.getInstallableType().encodeToString());
return stringBuffer.toString();
}
public BObject decodeFromString(String string) throws IOException {
BInstallableSpec bInstallableSpec = new BInstallableSpec();
String[] stringArray = TextUtil.split((String)string, (char)';');
bInstallableSpec.setInstallableName(stringArray[0]);
bInstallableSpec.getVersion().setBajaVersionString(stringArray[1]);
bInstallableSpec.getVersion().setVendor(stringArray[2]);
bInstallableSpec.getVersion().setVendorVersionString(stringArray[3]);
bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decodeFromString(stringArray[4]));
return bInstallableSpec;
}
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 BInstallableSpec() {
}
public BInstallableSpec(String string, Version version, Type type) {
this(string, new BVersion(version.toString()), type);
}
public BInstallableSpec(String string, BVersion bVersion, Type type) {
this.setInstallableName(string);
this.setVersion(bVersion);
this.setInstallableType(type.getTypeSpec());
}
static {
Class clazz = class$com$tridium$install$installable$BInstallableSpec;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BInstallableSpec = BInstallableSpec.class("[Lcom.tridium.install.installable.BInstallableSpec;", false);
}
TYPE = Sys.loadType((Class)clazz);
DEFAULT = new BInstallableSpec();
}
}
@@ -0,0 +1,315 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.registry.NModuleInfo
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.BLocalFileStore
* javax.baja.file.FilePath
* javax.baja.file.zip.BZipFile
* javax.baja.file.zip.BZipSpace
* javax.baja.naming.SlotPath
* javax.baja.naming.UnresolvedException
* javax.baja.sys.Action
* javax.baja.sys.BIcon
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.SlotCursor
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.xml.XElem
*/
package com.tridium.install.installable;
import com.tridium.install.BDaemonPlatform;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.installable.BInstallable;
import com.tridium.install.part.BModulePart;
import com.tridium.platform.daemon.DaemonFileUtil;
import com.tridium.platform.daemon.file.StoreCache;
import com.tridium.platform.daemon.message.FileTransferMessageElement;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import com.tridium.sys.registry.NModuleInfo;
import java.io.InputStream;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.BLocalFileStore;
import javax.baja.file.FilePath;
import javax.baja.file.zip.BZipFile;
import javax.baja.file.zip.BZipSpace;
import javax.baja.naming.SlotPath;
import javax.baja.naming.UnresolvedException;
import javax.baja.platform.ICancelHint;
import javax.baja.sys.Action;
import javax.baja.sys.BIcon;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.xml.XElem;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BModuleInstallable
extends BInstallable {
public static final Action trace = BModuleInstallable.newAction((int)0, null);
public static final Type TYPE;
private static final BIcon icon;
private boolean localInstance;
private boolean dependsInitialized;
private RuntimeException throwMe;
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
public void trace() {
this.invoke(trace, null, null);
}
public Type getType() {
return TYPE;
}
public BModulePart getModulePart() {
SlotCursor slotCursor = this.getParts().getProperties();
slotCursor.next();
return (BModulePart)slotCursor.get();
}
public BVector getDependencies() {
if (this.localInstance && !this.dependsInitialized) {
BVector bVector = (BVector)this.get(dependencies);
bVector.removeAll();
SlotCursor slotCursor = this.getModulePart().getDependencies().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
bVector = (BVector)this.get(exclusions);
bVector.removeAll();
slotCursor = this.getModulePart().getExclusions().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
this.dependsInitialized = true;
}
return super.getDependencies();
}
public BVector getExclusions() {
if (this.localInstance && !this.dependsInitialized) {
this.getDependencies();
}
return super.getExclusions();
}
public void close() {
}
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
if (bDaemonPlatform == null || !this.localInstance || this.getInstallableName().equals("baja") || this.getModulePart().getManifest().noRunningStation()) {
return 2;
}
bDaemonPlatform.getModuleList().init(daemonSessionTaskListener);
if (bDaemonPlatform.getModuleList().meets(BDependency.forModule(this.getInstallableName()))) {
return 2;
}
return 4;
}
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
if (!this.localInstance) {
throw new IllegalStateException("illegal call on proxy instance of BModuleInstallable");
}
return new FileTransferMessageElement[]{this.getModulePart().makeTransferElement(bDaemonPlatform)};
}
public BInstallable makeLocalInstance() {
if (this.localInstance) {
return this;
}
try {
return BModuleInstallable.make((BIFile)this.getInstallableFileOrd().get());
}
catch (UnresolvedException unresolvedException) {
return null;
}
}
public boolean equivalent(Object object) {
if (object instanceof BModuleInstallable) {
BModuleInstallable bModuleInstallable = (BModuleInstallable)object;
boolean bl = false;
if (bModuleInstallable.getInstallableName().equals(this.getInstallableName()) && bModuleInstallable.getVersion().equivalent((Object)this.getVersion())) {
bl = true;
}
return bl;
}
return false;
}
public static BInstallable make(BIFile bIFile) {
return BModuleInstallable.make(bIFile, true);
}
public static BModuleInstallable make(NModuleInfo nModuleInfo) {
FilePath filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".jar");
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath);
if (bIFile == null && (bIFile = BFileSystem.INSTANCE.findFile(filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".sjar"))) == null) {
return null;
}
return new BModuleInstallable(bIFile, nModuleInfo);
}
public static BModuleInstallable make(BIFile bIFile, boolean bl) {
return BModuleInstallable.make(bIFile, bl, true);
}
public static BModuleInstallable make(BIFile bIFile, boolean bl, boolean bl2) {
InputStream inputStream = null;
try {
if (bIFile.getStore() instanceof BLocalFileStore) {
BZipFile bZipFile = bIFile instanceof BZipFile ? (BZipFile)bIFile : new BZipFile(bIFile.getStore());
BZipSpace bZipSpace = (BZipSpace)bZipFile.open();
BIFile bIFile2 = bZipSpace.findFile(new FilePath("META-INF/module.xml"));
if (bIFile2 == null && (bIFile2 = bZipSpace.findFile(new FilePath("meta-inf/module.xml"))) == null) {
try {
bZipFile.close();
}
catch (Exception exception) {}
inputStream = null;
}
inputStream = new DaemonFileUtil.ZipEntryInputStream(bZipFile, bIFile2);
} else {
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml"));
if (inputStream == null) {
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("meta-inf/module.xml"));
}
}
if (inputStream == null) {
if (bl) {
return new BModuleInstallable(bIFile, null);
}
return null;
}
return new BModuleInstallable(bIFile, inputStream, bl2);
}
catch (Exception exception) {
return new BModuleInstallable(bIFile, null);
}
}
public void doTrace() {
throw this.throwMe;
}
public BIcon getIcon() {
return icon;
}
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());
}
}
private final /* synthetic */ void this() {
this.localInstance = false;
this.dependsInitialized = false;
}
public BModuleInstallable() {
this.this();
this.throwMe = new RuntimeException("check");
}
private BModuleInstallable(BIFile bIFile, NModuleInfo nModuleInfo) {
this.this();
this.throwMe = new RuntimeException("check");
this.setInstallableFileProperties(bIFile);
BModulePart bModulePart = new BModulePart(bIFile, nModuleInfo, (BInstallable)this);
bModulePart.setInstallable(this);
this.setInstallableName(bModulePart.getPartName());
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
this.setDescription(bModulePart.getDescription());
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
this.localInstance = true;
}
private BModuleInstallable(BIFile bIFile, InputStream inputStream) {
this(bIFile, inputStream, true);
}
private BModuleInstallable(BIFile bIFile, InputStream inputStream, boolean bl) {
this.this();
this.throwMe = new RuntimeException("check");
this.setInstallableFileProperties(bIFile);
BModulePart bModulePart = new BModulePart(bIFile, inputStream, this, bl);
bModulePart.setInstallable(this);
this.setInstallableName(bModulePart.getPartName());
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
this.setDescription(bModulePart.getDescription());
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
BVector bVector = (BVector)this.get(dependencies);
bVector.removeAll();
SlotCursor slotCursor = bModulePart.getDependencies().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
bVector = (BVector)this.get(exclusions);
bVector.removeAll();
slotCursor = bModulePart.getExclusions().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
this.setIsInstallable(bModulePart.getIsInstallable());
this.dependsInitialized = true;
this.localInstance = true;
}
public BModuleInstallable(long l, String string, XElem xElem) {
this.this();
this.throwMe = new RuntimeException("check");
this.setInstallableFileName(string);
this.setInstallableFileSize(l);
BModulePart bModulePart = BModulePart.make(string.substring(0, string.length() - 4), xElem);
this.setInstallableName(bModulePart.getPartName());
bModulePart.setFileSize(l);
bModulePart.setInstallable(this);
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
this.setDescription(bModulePart.getDescription());
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
BVector bVector = (BVector)this.get(dependencies);
bVector.removeAll();
SlotCursor slotCursor = bModulePart.getDependencies().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
bVector = (BVector)this.get(exclusions);
bVector.removeAll();
slotCursor = bModulePart.getExclusions().getProperties();
while (slotCursor.next()) {
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
}
this.setIsInstallable(bModulePart.getIsInstallable());
this.dependsInitialized = true;
}
static {
Class clazz = class$com$tridium$install$installable$BModuleInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BModuleInstallable = BModuleInstallable.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"module.png");
}
}
@@ -0,0 +1,532 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.FilePath
* javax.baja.nre.util.Array
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BAbsTime
* javax.baja.util.BTypeSpec
* javax.baja.xml.XContent
* javax.baja.xml.XElem
* javax.baja.xml.XWriter
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.installable.BDistribution;
import com.tridium.install.part.BBrandPart;
import com.tridium.install.part.BGenericPart;
import com.tridium.install.part.BPart;
import java.io.IOException;
import java.io.OutputStream;
import javax.baja.file.FilePath;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.TextUtil;
import javax.baja.platform.install.BFileReconciler;
import javax.baja.platform.install.BVersionRelation;
import javax.baja.sys.BAbsTime;
import javax.baja.util.BTypeSpec;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
import javax.baja.xml.XWriter;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BundleManifest {
public static final int REPLACE_DEFAULT = -1;
public static final int REPLACE_NEVER = 0;
public static final int REPLACE_ALWAYS = 1;
public static final int REPLACE_CRC = 2;
public static final int DO_NOT_COPY = 3;
public static final int REPLACE_HOSTID = 4;
private static String[] replaceString = new String[]{"never", "always", "crc", "nocopy", "hostid"};
protected XElem rootElem;
protected XElem fileHandlingElem;
protected XElem depsElem;
protected XElem exclElem;
protected XElem providesElem;
protected XElem resourcesElem;
static /* synthetic */ Class class$com$tridium$install$installable$BundleManifest$FileHandlingRule;
static /* synthetic */ Class class$com$tridium$install$BDependency;
static /* synthetic */ Class class$com$tridium$install$part$BPart;
public void write(OutputStream outputStream) throws IOException {
XWriter xWriter = new XWriter(outputStream);
this.rootElem.write(xWriter);
xWriter.flush();
}
public String getBuildDate() {
return this.rootElem.get("buildDate", "");
}
public void setBuildDate(BAbsTime bAbsTime) {
if (bAbsTime != null) {
this.rootElem.setAttr("buildDate", bAbsTime.toString());
}
}
public String getBuildHost() {
return this.rootElem.get("buildHost", "");
}
public void setBuildHost(String string) {
this.rootElem.setAttr("buildHost", string);
}
public String getDescription() {
return this.rootElem.get("description", "");
}
public void setDescription(String string) {
this.rootElem.setAttr("description", string);
}
public String getInstallableName() {
return this.rootElem.get("name", "");
}
public void setInstallableName(String string) {
this.rootElem.setAttr("name", string);
}
public BVersion getInstallableVersion() {
return new BVersion(this.rootElem.get("vendor", ""), this.rootElem.get("version", ""));
}
public void setInstallableVersion(BVersion bVersion) {
this.rootElem.setAttr("vendor", bVersion.getVendor());
this.rootElem.setAttr("version", bVersion.getVendorVersionString());
}
public boolean useAbsoluteElementPaths() {
return this.rootElem.getb("absoluteElementPaths", false);
}
public void setUseAbsoluteElementPaths(boolean bl) {
this.rootElem.setAttr("absoluteElementPaths", String.valueOf(bl));
}
public int getDefaultReplaceRule() {
String string = this.fileHandlingElem.get("replace", "crc");
int n = 0;
while (n < replaceString.length) {
if (replaceString[n].equals(string)) {
return n;
}
++n;
}
return 2;
}
public void setDefaultReplaceRule(int n) {
this.fileHandlingElem.setAttr("replace", replaceString[n]);
}
public FileHandlingRule[] getFileHandlingRules() {
XElem[] xElemArray = this.fileHandlingElem.elems();
Class clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule = BundleManifest.class("[Lcom.tridium.install.installable.BundleManifest$FileHandlingRule;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < xElemArray.length) {
if (xElemArray[n].name().equals("dir")) {
array.add((Object)new DirHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null), xElemArray[n].getb("clean", false)));
} else if (xElemArray[n].name().equals("file")) {
array.add((Object)new FileHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null)));
} else if (xElemArray[n].name().equals("remove")) {
array.add((Object)new RemoveRule(xElemArray[n].get("name")));
} else {
throw new IllegalStateException("unrecognized file handling rule type '" + xElemArray[n].name() + '\'');
}
++n;
}
xElemArray = this.resourcesElem.elems();
n = 0;
while (n < xElemArray.length) {
if (xElemArray[n].get("content", null) != null) {
array.add((Object)new FileHandlingRule(xElemArray[n].get("content"), "nocopy"));
}
++n;
}
return (FileHandlingRule[])array.trim();
}
public void addFileToRemove(String string) {
XElem xElem = new XElem("remove");
xElem.setAttr("name", string);
this.fileHandlingElem.addContent((XContent)xElem);
}
public void addDir(String string, boolean bl) {
this.addDir(string, -1, bl);
}
public void addDir(String string, int n) {
this.addDir(string, n, false);
}
public void addDir(String string, int n, boolean bl) {
XElem xElem = new XElem("dir");
xElem.setAttr("name", string);
if (n >= 0) {
xElem.setAttr("replace", replaceString[n]);
}
if (bl) {
xElem.setAttr("clean", "true");
}
this.fileHandlingElem.addContent((XContent)xElem);
}
public void addFile(String string) {
this.addFile(string, -1);
}
public void addFile(String string, int n) {
XElem xElem = new XElem("file");
xElem.setAttr("name", string);
if (n >= 0) {
xElem.setAttr("replace", replaceString[n]);
}
this.fileHandlingElem.addContent((XContent)xElem);
}
public void addFile(String string, BTypeSpec bTypeSpec, int n) {
XElem xElem = new XElem("file");
xElem.setAttr("name", string);
if (n == -1) {
xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString());
} else {
xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString() + ':' + replaceString[n]);
}
this.fileHandlingElem.addContent((XContent)xElem);
}
public BDependency[] getDependencies() {
XElem[] xElemArray = this.depsElem.elems();
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < xElemArray.length) {
BDependency bDependency = BDependency.make(xElemArray[n]);
if (!(bDependency == null || bDependency.getPartTypeSpec().equals((Object)BBrandPart.TYPE.getTypeSpec()) && (bDependency.getPartName().equals("noBrand") || bDependency.getPartName().equals("nullos") || bDependency.getPartName().equals("disabled")))) {
if (bDependency.getVersionRelation() == BVersionRelation.exact && bDependency.getPartTypeSpec().equals((Object)BGenericPart.TYPE.getTypeSpec()) && this.providesElem.elems().length == 0) {
bDependency.setVersion(BVersion.makeZero());
bDependency.setVersionRelation(BVersionRelation.minimum);
}
array.add((Object)bDependency);
}
++n;
}
return (BDependency[])array.trim();
}
public BDependency[] getExclusions() {
XElem[] xElemArray = this.exclElem.elems();
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < xElemArray.length) {
BDependency bDependency = BDependency.make(xElemArray[n]);
if (bDependency != null) {
array.add((Object)bDependency);
}
++n;
}
return (BDependency[])array.trim();
}
public void addDependency(BDependency bDependency) {
this.depsElem.addContent((XContent)bDependency.getXml());
}
public void addExclusion(BDependency bDependency) {
this.exclElem.addContent((XContent)bDependency.getXml());
}
public InstallableResourceMetadata[] getInstallableResources() {
XElem[] xElemArray = this.resourcesElem.elems("installable");
InstallableResourceMetadata[] installableResourceMetadataArray = new InstallableResourceMetadata[xElemArray.length];
int n = 0;
while (n < xElemArray.length) {
installableResourceMetadataArray[n] = new InstallableResourceMetadata(xElemArray[n]);
++n;
}
return installableResourceMetadataArray;
}
public BPart[] getProvidedParts(BDistribution bDistribution) {
XElem[] xElemArray = this.providesElem.elems();
Class clazz = class$com$tridium$install$part$BPart;
if (clazz == null) {
clazz = class$com$tridium$install$part$BPart = BundleManifest.class("[Lcom.tridium.install.part.BPart;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < xElemArray.length) {
BPart bPart = BPart.makePart(xElemArray[n], bDistribution);
if (bPart != null) {
array.add((Object)bPart);
}
++n;
}
return (BPart[])array.trim();
}
public void addProvidedPart(BPart bPart) {
this.providesElem.addContent((XContent)bPart.getXml());
}
public String getEntryPath(FilePath filePath, String string) {
FilePath filePath2 = this.getNormalFilePath(filePath, string);
return filePath2 == null ? null : this.getEntryPath(filePath2);
}
/*
* Enabled force condition propagation
* Lifted jumps to return sites
*/
public String getEntryPath(FilePath filePath) {
StringBuffer stringBuffer = new StringBuffer();
if (filePath.isSysHomeAbsolute()) {
if (this.useAbsoluteElementPaths()) {
stringBuffer.append("niagara");
}
int n = 0;
while (n < filePath.depth()) {
if (stringBuffer.length() > 0) {
stringBuffer.append('/');
}
stringBuffer.append(filePath.nameAt(n));
if (n == 0 && filePath.nameAt(n).equals("bin")) {
stringBuffer.append("/stage");
}
++n;
}
return stringBuffer.toString();
} else {
if (!filePath.isLocalAbsolute()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": only local and system home absolute paths supported");
if (!this.useAbsoluteElementPaths()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": local absolute paths unsupported");
int n = 0;
while (n < filePath.depth()) {
if (stringBuffer.length() > 0) {
stringBuffer.append('/');
}
stringBuffer.append(filePath.nameAt(n));
++n;
}
}
return stringBuffer.toString();
}
public FilePath getNormalFilePath(FilePath filePath) {
return this.getNormalFilePath(filePath, null);
}
public FilePath getNormalFilePath(FilePath filePath, String string) {
if (filePath.isStationHomeAbsolute()) {
if (string == null) {
return null;
}
FilePath filePath2 = new FilePath("!stations");
filePath2 = filePath2.merge(string);
int n = 0;
while (n < filePath.depth()) {
filePath2 = filePath2.merge(filePath.nameAt(n));
++n;
}
return filePath2;
}
if (filePath.isSysHomeAbsolute()) {
return filePath;
}
if (filePath.isLocalAbsolute()) {
if (this.useAbsoluteElementPaths()) {
return filePath;
}
return null;
}
return null;
}
static /* synthetic */ String[] access$0() {
return replaceString;
}
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());
}
}
protected BundleManifest(XElem xElem) throws Exception {
this.rootElem = xElem.copy();
this.fileHandlingElem = this.rootElem.elem("fileHandling");
if (this.fileHandlingElem == null) {
this.fileHandlingElem = new XElem("fileHandling");
this.rootElem.addContent((XContent)this.fileHandlingElem);
}
this.depsElem = this.rootElem.elem("dependencies");
if (this.depsElem == null) {
this.depsElem = new XElem("dependencies");
xElem.addContent((XContent)this.depsElem);
}
this.providesElem = this.rootElem.elem("provides");
if (this.providesElem == null) {
this.providesElem = new XElem("provides");
this.rootElem.addContent((XContent)this.providesElem);
}
this.exclElem = this.rootElem.elem("exclusions");
if (this.exclElem == null) {
this.exclElem = new XElem("exclusions");
xElem.addContent((XContent)this.exclElem);
}
this.resourcesElem = this.rootElem.elem("resources");
if (this.resourcesElem == null) {
this.resourcesElem = new XElem("resources");
xElem.addContent((XContent)this.resourcesElem);
}
}
protected BundleManifest() {
this.rootElem = new XElem("dist");
this.fileHandlingElem = new XElem("fileHandling");
this.rootElem.addContent((XContent)this.fileHandlingElem);
this.depsElem = new XElem("dependencies");
this.rootElem.addContent((XContent)this.depsElem);
this.exclElem = new XElem("exclusions");
this.rootElem.addContent((XContent)this.exclElem);
this.providesElem = new XElem("provides");
this.rootElem.addContent((XContent)this.providesElem);
this.resourcesElem = new XElem("resources");
this.rootElem.addContent((XContent)this.resourcesElem);
}
public static class DirHandlingRule
extends FileHandlingRule {
public boolean clean;
public DirHandlingRule(String string, String string2, boolean bl) {
super(string, string2);
this.clean = bl;
}
public DirHandlingRule(String string, int n, boolean bl) {
super(string, n);
this.clean = bl;
}
}
public static class FileHandlingRule {
public String entryPath;
public int replaceRule;
public BFileReconciler reconciler;
/*
* Unable to fully structure code
* Enabled force condition propagation
* Lifted jumps to return sites
*/
public FileHandlingRule(String var1_1, String var2_2) {
super();
this.entryPath = var1_1;
this.replaceRule = -1;
if (var2_2 == null || var2_2.trim().length() <= 0) return;
var3_3 = TextUtil.split((String)var2_2, (char)':');
if (var3_3[0].equals("reconcile")) {
try {
this.reconciler = (BFileReconciler)BTypeSpec.make((String)var3_3[1], (String)var3_3[2]).getInstance();
return;
}
catch (Exception var4_4) {
if (var3_3.length <= 3) return;
var5_6 = 0;
** while (var5_6 < BundleManifest.access$0().length)
}
lbl-1000:
// 1 sources
{
if (BundleManifest.access$0()[var5_6].equals(var3_3[3])) {
this.replaceRule = var5_6;
return;
} else {
++var5_6;
continue;
}
lbl19:
// 1 sources
return;
}
}
var4_5 = 0;
while (var4_5 < BundleManifest.access$0().length) {
if (BundleManifest.access$0()[var4_5].equals(var2_2)) {
this.replaceRule = var4_5;
return;
}
++var4_5;
}
}
public FileHandlingRule(String string, int n) {
this.entryPath = string;
this.replaceRule = n;
}
}
public static class RemoveRule
extends FileHandlingRule {
public RemoveRule(String string) {
super(string, -1);
}
}
public static class InstallableResourceMetadata {
public XElem elem;
public String getContentEntryPath() {
return this.elem.get("content");
}
public String getInstallableName() {
return this.elem.get("name");
}
public String getProvidedPartType() {
return this.elem.get("type");
}
public BVersion getVersion() {
return new BVersion(this.elem.get("vendor", ""), this.elem.get("vendorVersion"));
}
public XElem makeDependencyElem() {
return new XElem(this.elem.get("type")).addAttr("name", this.elem.get("name")).addAttr("vendor", this.elem.get("vendor", "")).addAttr("version", this.elem.get("vendorVersion")).addAttr("rel", "exact");
}
public InstallableResourceMetadata(XElem xElem) {
this.elem = xElem;
}
}
}
@@ -0,0 +1,15 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.Cursor
*/
package com.tridium.install.installable;
import javax.baja.sys.Cursor;
public interface ClosableCursor
extends Cursor {
public void close();
}
@@ -0,0 +1,224 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.Cursor
*/
package com.tridium.install.installable;
import com.tridium.install.installable.ClosableCursor;
import java.util.Collection;
import java.util.Iterator;
import javax.baja.nre.util.Array;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.Cursor;
public class CursorUtil {
public static ClosableCursor closable(Cursor cursor) {
return cursor instanceof ClosableCursor ? (ClosableCursor)cursor : new Closable(cursor);
}
public static Cursor cursor(Collection collection) {
return CursorUtil.cursor(collection, null);
}
public static Cursor cursor(Collection collection, Context context) {
return CursorUtil.cursor(collection.iterator(), context);
}
public static Cursor cursor(Iterator iterator) {
return CursorUtil.cursor(iterator, null);
}
public static Cursor cursor(Iterator iterator, Context context) {
return new IteratorCursor(iterator, context);
}
public static Cursor cursor(Object[] objectArray) {
return CursorUtil.cursor(objectArray, null);
}
public static Cursor cursor(Object[] objectArray, Context context) {
return CursorUtil.cursor(new Array(objectArray), context);
}
public static Cursor cursor(Array array) {
return CursorUtil.cursor(array, null);
}
public static Cursor cursor(Array array, Context context) {
return new ArrayCursor(array, context);
}
public static class Closable
implements ClosableCursor {
private Cursor innerCursor;
public Context getContext() {
return this.innerCursor.getContext();
}
public boolean next() {
return this.innerCursor.next();
}
public boolean nextComponent() {
return this.innerCursor.nextComponent();
}
public boolean next(Class clazz) {
return this.innerCursor.next(clazz);
}
public BObject get() {
return this.innerCursor.get();
}
public void close() {
}
public Closable(Cursor cursor) {
this.innerCursor = cursor;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public static class IteratorCursor
implements Cursor {
private Iterator i;
private BObject current;
private Context cx;
static /* synthetic */ Class class$javax$baja$sys$BComponent;
public Context getContext() {
return this.cx;
}
public boolean next() {
if (this.i.hasNext()) {
this.current = (BObject)this.i.next();
return true;
}
return false;
}
public boolean nextComponent() {
Class clazz = class$javax$baja$sys$BComponent;
if (clazz == null) {
clazz = class$javax$baja$sys$BComponent = IteratorCursor.class("[Ljavax.baja.sys.BComponent;", false);
}
return this.next(clazz);
}
public boolean next(Class clazz) {
while (this.next()) {
if (!clazz.isAssignableFrom(this.current.getClass())) continue;
return true;
}
return false;
}
public BObject get() {
return this.current;
}
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());
}
}
private final /* synthetic */ void this() {
this.current = null;
}
public IteratorCursor(Iterator iterator, Context context) {
this.this();
this.i = iterator;
this.cx = context;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public static class ArrayCursor
implements Cursor {
private int index;
private Array a;
private Context cx;
static /* synthetic */ Class class$javax$baja$sys$BComponent;
public Context getContext() {
return this.cx;
}
public boolean next() {
if (this.index >= this.a.size() - 1) {
return false;
}
++this.index;
return true;
}
public boolean nextComponent() {
Class clazz = class$javax$baja$sys$BComponent;
if (clazz == null) {
clazz = class$javax$baja$sys$BComponent = ArrayCursor.class("[Ljavax.baja.sys.BComponent;", false);
}
return this.next(clazz);
}
public boolean next(Class clazz) {
while (this.next()) {
if (!clazz.isAssignableFrom(this.get().getClass())) continue;
return true;
}
return false;
}
public BObject get() {
if (this.index < 0 || this.index >= this.a.size()) {
return null;
}
return (BObject)this.a.get(this.index);
}
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());
}
}
private final /* synthetic */ void this() {
this.index = -1;
}
public ArrayCursor(Array array, Context context) {
this.this();
this.a = array;
this.cx = context;
}
}
}
@@ -0,0 +1,326 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BIFile
* javax.baja.nre.util.Array
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.timezone.BTimeZone
* javax.baja.util.Version
* javax.baja.xml.XContent
* javax.baja.xml.XElem
* javax.baja.xml.XParser
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.installable.BundleManifest;
import com.tridium.install.part.BNrePart;
import com.tridium.install.part.BOsPart;
import com.tridium.install.part.BPart;
import com.tridium.platform.daemon.BDaemonSession;
import com.tridium.platform.daemon.BModuleContent;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import com.tridium.platform.tcpip.BTcpIpPlatformService;
import com.tridium.platform.tcpip.TcpUtil;
import java.io.InputStream;
import javax.baja.file.BIFile;
import javax.baja.nre.util.Array;
import javax.baja.platform.install.BVersionRelation;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.timezone.BTimeZone;
import javax.baja.util.Version;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class DistributionManifest
extends BundleManifest {
private XElem platformElem;
private XElem tcpIpElem;
static /* synthetic */ Class class$com$tridium$install$BDependency;
public static DistributionManifest make() {
return new DistributionManifest();
}
public static DistributionManifest make(InputStream inputStream) throws Exception {
return DistributionManifest.make(inputStream, true);
}
public static DistributionManifest make(InputStream inputStream, boolean bl) throws Exception {
return DistributionManifest.make(XParser.make((InputStream)inputStream).parse(bl));
}
public static DistributionManifest make(XElem xElem) throws Exception {
return new DistributionManifest(xElem);
}
public boolean isDaemonBinaryUpdateRequired() {
return this.rootElem.getb("updateDaemonBinaries", false);
}
public void setDaemonBinaryUpdateRequired(boolean bl) {
this.rootElem.setAttr("updateDaemonBinaries", String.valueOf(bl));
}
public boolean noRunningStation() {
boolean bl = true;
if (!this.noRunningApp()) {
bl = this.rootElem.getb("noRunningStation", false);
}
return bl;
}
public void setNoRunningStation(boolean bl) {
this.rootElem.setAttr("noRunningStation", String.valueOf(bl));
}
public boolean noRunningApp() {
return this.rootElem.getb("noRunningApp", this.rootElem.getb("noStation", false));
}
public void setNoRunningApp(boolean bl) {
this.rootElem.setAttr("noRunningApp", String.valueOf(bl));
this.rootElem.setAttr("noStation", String.valueOf(bl));
}
public String getHostId() {
return this.rootElem.get("hostId", null);
}
public void setHostId(String string) {
if (string != null) {
this.rootElem.setAttr("hostId", string);
}
}
public boolean isOsUpdateRequired() {
return this.rootElem.getb("osInstall", false);
}
public void setOsUpdateRequired(boolean bl) {
this.rootElem.setAttr("osInstall", String.valueOf(bl));
}
public boolean isStandalone() {
return this.rootElem.getb("standalone", false);
}
public void setIsStandalone(boolean bl) {
this.rootElem.setAttr("standalone", String.valueOf(bl));
}
public boolean isRebootRequired() {
return this.rootElem.getb("reboot", false);
}
public void setRebootRequired(boolean bl) {
this.rootElem.setAttr("reboot", String.valueOf(bl));
}
public boolean ignoreDefaultExclusions() {
return this.rootElem.getb("ignoreDefaultExclusions", false);
}
public void setIgnoreDefaultExclusions(boolean bl) {
this.rootElem.setAttr("ignoreDefaultExclusions", String.valueOf(bl));
}
public void setTargetOs(BOsPart bOsPart) {
this.setUseAbsoluteElementPaths(bOsPart.allowGlobalFileAccess());
}
public BModuleContent getUpdateModuleContent() {
String string = this.rootElem.get("setInstallFlag", null);
if (string == null) {
return null;
}
return BModuleContent.make(string);
}
public void setUpdateModuleContent(BModuleContent bModuleContent) {
this.rootElem.setAttr("setInstallFlag", bModuleContent.getTag());
}
public void setNewOsTimeZone(BTimeZone bTimeZone) throws Exception {
if (bTimeZone == null) {
bTimeZone = BTimeZone.NULL;
}
this.rootElem.setAttr("osTimeZone", bTimeZone.encodeToString());
}
public BTimeZone getNewOsTimeZone() {
String string = this.rootElem.get("osTimeZone", null);
if (string == null) {
return BTimeZone.NULL;
}
try {
return (BTimeZone)BTimeZone.DEFAULT.decodeFromString(string);
}
catch (Exception exception) {
exception.printStackTrace();
return BTimeZone.NULL;
}
}
public BDependency[] getExclusions() {
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = DistributionManifest.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
array.addAll((Object[])super.getExclusions());
if (!this.ignoreDefaultExclusions()) {
BPart[] bPartArray = this.getProvidedParts(null);
if (bPartArray.length > 0) {
this.addDefaultOsExclusions(bPartArray[0], array);
this.addDefaultNreCoreExclusions(bPartArray[0], array);
}
this.addDefaultNreConfigExclusions(array);
}
return (BDependency[])array.trim();
}
protected void addDefaultOsExclusions(BPart bPart, Array array) {
if (bPart.getType().equals(BOsPart.TYPE) && bPart.getPartName().startsWith("qnx")) {
Version version = bPart.getVersion().getVendorVersion();
if (version.major() == 1) {
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "2.0"), bPart.getType().getTypeSpec()));
} else if (version.size() >= 2) {
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec()));
}
}
}
protected void addDefaultNreCoreExclusions(BPart bPart, Array array) {
Version version;
if (bPart.getType().equals(BNrePart.TYPE) && bPart.getPartName().startsWith("nre-core-qnx") && (version = bPart.getVersion().getVendorVersion()).size() >= 2) {
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec()));
}
}
protected void addDefaultNreConfigExclusions(Array array) {
if (this.getInstallableName().startsWith("nre-config")) {
BDependency[] bDependencyArray = this.getDependencies();
int n = 0;
while (n < bDependencyArray.length) {
if (bDependencyArray[n].getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec()) && bDependencyArray[n].getPartName().startsWith("qnx") && bDependencyArray[n].getVersionRelation() != BVersionRelation.exact) {
Version version = bDependencyArray[n].getVersion().getVendorVersion();
if (version.major() == 1) {
array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "2.0"), bDependencyArray[n].getPartTypeSpec()));
} else if (version.size() >= 2) {
array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bDependencyArray[n].getPartTypeSpec()));
}
return;
}
++n;
}
}
}
public XElem getPlatformXml() {
return this.platformElem;
}
public void setPlatformXml(XElem xElem) {
if (this.platformElem != null) {
this.rootElem.removeContent((XContent)this.platformElem);
}
this.platformElem = xElem;
this.rootElem.addContent((XContent)this.platformElem);
}
public void setPlatformBog(BIFile bIFile) throws Exception {
this.setPlatformBog(bIFile, true);
}
public void setPlatformBog(BIFile bIFile, boolean bl) throws Exception {
XElem xElem = new XElem("platform");
if (!bl) {
xElem.setAttr("merge", "false");
}
InputStream inputStream = bIFile.getInputStream();
XElem xElem2 = XParser.make((InputStream)inputStream).parse().elem(0);
XElem[] xElemArray = xElem2.elems("p");
int n = 0;
while (n < xElemArray.length) {
xElem.addContent((XContent)xElemArray[n].copy());
++n;
}
try {
inputStream.close();
}
catch (Exception exception) {}
this.setPlatformXml(xElem);
}
public BTcpIpHostSettings getTcpIpSettings() {
if (this.tcpIpElem == null) {
return null;
}
BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings();
TcpUtil.updateFields(bTcpIpHostSettings, this.tcpIpElem);
return bTcpIpHostSettings;
}
public void setTcpIpSettings(BTcpIpHostSettings bTcpIpHostSettings) throws Exception {
if (this.tcpIpElem != null) {
this.rootElem.removeContent((XContent)this.tcpIpElem);
}
if (bTcpIpHostSettings == null) {
this.tcpIpElem = null;
} else if (!bTcpIpHostSettings.getIsReadonly()) {
this.tcpIpElem = TcpUtil.getHostSettingsXml(bTcpIpHostSettings);
this.rootElem.addContent((XContent)this.tcpIpElem);
}
}
public void setStationTcpIpSettings() throws Exception {
BTcpIpPlatformService bTcpIpPlatformService = (BTcpIpPlatformService)Sys.getService((Type)BTcpIpPlatformService.TYPE);
bTcpIpPlatformService.poll();
this.setTcpIpSettings(bTcpIpPlatformService.getSettings());
}
public void setDaemonTcpIpSettings(BDaemonSession bDaemonSession) throws Exception {
BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings();
TcpUtil.loadFromSession(bTcpIpHostSettings, bDaemonSession);
this.setTcpIpSettings(bTcpIpHostSettings);
}
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());
}
}
private final /* synthetic */ void this() {
this.platformElem = null;
this.tcpIpElem = null;
}
private DistributionManifest(XElem xElem) throws Exception {
super(xElem);
this.this();
this.platformElem = this.rootElem.elem("platform");
this.tcpIpElem = this.rootElem.elem("tcpIpSettings");
}
private DistributionManifest() {
this.this();
}
}
@@ -0,0 +1,20 @@
/*
* Decompiled with CFR 0.152.
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.installable.BInstallable;
import com.tridium.install.installable.ClosableCursor;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
public interface InstallableRegistry {
public BInstallable findInstallable(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
public BInstallable[] findInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
public ClosableCursor getInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
public ClosableCursor getInstallables(boolean var1, DaemonSessionTaskListener var2) throws Exception;
}
@@ -0,0 +1,938 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BDirectory
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.file.FileUtil
* javax.baja.naming.BOrd
* javax.baja.naming.OrdQuery
* javax.baja.nre.util.Array
* javax.baja.nre.util.IFilter
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.SlotCursor
* javax.baja.sys.Type
* javax.baja.util.BTypeSpec
* javax.baja.util.Lexicon
* javax.baja.util.PatternFilter
* javax.baja.util.Version
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.BRegisteredModuleList;
import com.tridium.install.BVersion;
import com.tridium.install.FilenameFilterUtil;
import com.tridium.install.installable.BInstallable;
import com.tridium.install.installable.BModuleInstallable;
import com.tridium.install.installable.ClosableCursor;
import com.tridium.install.installable.InstallableRegistry;
import com.tridium.install.part.BModulePart;
import com.tridium.install.part.BPart;
import com.tridium.platform.daemon.BModuleContent;
import com.tridium.platform.daemon.file.FilePathComparator;
import com.tridium.platform.daemon.task.DaemonSessionTask;
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.baja.file.BDirectory;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.file.FileUtil;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.IFilter;
import javax.baja.platform.install.BVersionRelation;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Type;
import javax.baja.util.BTypeSpec;
import javax.baja.util.Lexicon;
import javax.baja.util.PatternFilter;
import javax.baja.util.Version;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class LocalInstallableRegistry
implements InstallableRegistry {
private static LocalInstallableRegistry INSTANCE = null;
public static final BTypeSpec MODULE_PART = BModulePart.TYPE.getTypeSpec();
public static final BTypeSpec MODULE_INST = BModuleInstallable.TYPE.getTypeSpec();
public static final FilePath SW_PATH = new FilePath("!sw");
public static final String INBOX_DIR = "inbox";
public static final String FAILED_DIR = "failed_imports";
public static final FilePath INBOX_PATH = SW_PATH.merge("inbox");
public static final FilePath MODULES_PATH = new FilePath("!modules");
private static final Lexicon lex = Lexicon.make((String)"platform");
private boolean initialized;
private InstallableCache installableCache;
private boolean initializing;
private Array listeners;
private HashMap installableTypesByFileExt;
static /* synthetic */ Class class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener;
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
static /* synthetic */ Class class$com$tridium$install$part$BPart;
static /* synthetic */ Class class$com$tridium$install$installable$BInstallable;
static /* synthetic */ Class class$javax$baja$file$BIFile;
static /* synthetic */ Class class$javax$baja$file$FilePath;
static /* synthetic */ Class class$javax$baja$sys$BComponent;
static /* synthetic */ Class class$com$tridium$install$installable$BDistribution;
public static LocalInstallableRegistry getInstance() {
if (INSTANCE == null) {
INSTANCE = new LocalInstallableRegistry();
}
return INSTANCE;
}
public void reload(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
this.reset();
this.init(daemonSessionTaskListener);
}
public void reset() {
this.initialized = false;
}
public void init() throws Exception {
this.init(null);
}
/*
* 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 init(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
if (!this.initialized) {
if (daemonSessionTaskListener == null) {
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
}
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
BFileSystem.INSTANCE.makeDir(SW_PATH);
this.initializing = true;
try {
daemonSessionTaskListener.taskStarted(daemonSessionTask);
this.installableCache = new InstallableCache();
this.importDirectory(BFileSystem.INSTANCE.makeDir(INBOX_PATH), daemonSessionTaskListener, daemonSessionTask, true);
BRegisteredModuleList.getInstance().doInit(daemonSessionTaskListener);
SlotCursor slotCursor = BRegisteredModuleList.getInstance().getModules().getProperties();
while (true) {
Class clazz;
if ((clazz = class$com$tridium$install$installable$BModuleInstallable) == null) {
clazz = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
}
if (slotCursor.next(clazz)) {
BModuleInstallable bModuleInstallable = (BModuleInstallable)slotCursor.get();
if (bModuleInstallable.getModulePart().getArchiveContent() != BModuleContent.doc) continue;
if (this.isRegistered(bModuleInstallable)) {
this.installableCache.register(SW_PATH.merge(bModuleInstallable.getVersion().getVendorVersion().toString()).merge(bModuleInstallable.getInstallableFileName()), (BInstallable)bModuleInstallable);
continue;
}
this.register(daemonSessionTask, bModuleInstallable, daemonSessionTaskListener, false);
continue;
}
break;
}
}
catch (Throwable throwable) {
Object var4_6 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
throw throwable;
}
{
Object var4_7 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
this.initialized = true;
this.initializing = false;
}
}
}
public boolean isRegistered(BInstallable bInstallable) throws Exception {
String string = bInstallable.getVersion().getVendorVersion() == null ? "0" : bInstallable.getVersion().getVendorVersion().toString();
BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(string));
BIFile bIFile = (BIFile)bDirectory.getNavChild(bInstallable.getInstallableFileName());
if (bIFile == null) {
return false;
}
BIFile bIFile2 = (BIFile)bInstallable.getInstallableFileOrd().get();
if (bIFile2 == null) {
return false;
}
return bIFile2.getLastModified().isAfter(bIFile.getLastModified());
}
public void register(BInstallable bInstallable, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
this.register(null, bInstallable, daemonSessionTaskListener, true);
}
/*
* 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 register(String string, String string2, BVersion bVersion, InputStream inputStream, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
if (!this.initializing) {
this.init(daemonSessionTaskListener);
}
if (daemonSessionTaskListener == null) {
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
}
if (bVersion.getVendorVersion().equals((Object)Version.ZERO)) {
return;
}
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
daemonSessionTaskListener.taskStarted(daemonSessionTask);
try {
BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(bVersion.getVendorVersion().toString()));
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyModule", new Object[]{string}));
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
BIFile bIFile = BFileSystem.INSTANCE.makeFile(bDirectory.getFilePath().merge(string2));
FileUtil.pipe((InputStream)inputStream, (OutputStream)bIFile.getOutputStream());
BInstallable bInstallable = BInstallable.make(bIFile);
this.installableCache.register(bIFile, bInstallable);
this.notifyRegistration(bInstallable);
}
catch (Throwable throwable) {
Object var8_11 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
throw throwable;
}
{
Object var8_12 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
return;
}
}
/*
* Exception decompiling
*/
private final void register(DaemonSessionTask var1_1, BInstallable var2_2, DaemonSessionTaskListener var3_3, boolean var4_4) throws Exception {
/*
* This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
*
* org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 1[TRYBLOCK] [1 : 274->278)] java.lang.Throwable
* at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
* at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
* at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
* at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
* at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
* at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
* at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
* at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
* at org.benf.cfr.reader.Main.main(Main.java:54)
*/
throw new IllegalStateException("Decompilation failed");
}
/*
* 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 importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
if (!this.initializing) {
this.init(daemonSessionTaskListener);
}
if (daemonSessionTaskListener == null) {
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
}
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
daemonSessionTaskListener.taskStarted(daemonSessionTask);
try {
this.importDirectory(bDirectory, daemonSessionTaskListener, daemonSessionTask, false);
}
catch (Throwable throwable) {
Object var5_5 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
throw throwable;
}
{
Object var5_6 = null;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
return;
}
}
private final void importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask, boolean bl) throws Exception {
BIFile[] bIFileArray = bDirectory.listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (bIFileArray[n] instanceof BDirectory) {
this.importDirectory((BDirectory)bIFileArray[n], daemonSessionTaskListener, daemonSessionTask, bl);
} else {
FilePath filePath;
FilePath filePath2;
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFileArray[n].getFilePath().getBody()}));
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
BInstallable bInstallable = BInstallable.make(bIFileArray[n]);
if (bInstallable == null || !bInstallable.getIsValid() || !bInstallable.getIsInstallable() || bInstallable instanceof BModuleInstallable && ((BModuleInstallable)bInstallable).getModulePart().getArchiveContent() != BModuleContent.doc) {
filePath2 = bIFileArray[n].getFilePath();
filePath = new FilePath(filePath2.getAbsoluteBase());
int n2 = 0;
while (n2 < filePath2.depth()) {
filePath = filePath2.nameAt(n2).equals(INBOX_DIR) ? filePath.merge(FAILED_DIR) : filePath.merge(filePath2.nameAt(n2));
++n2;
}
} else {
filePath = SW_PATH.merge(bInstallable.getVersion().getVendorVersion().toString()).merge(this.getNormalFileName(bInstallable, bIFileArray[n]));
bInstallable.setInstallableFileOrd(BOrd.make((OrdQuery)filePath));
}
if (!filePath.getBody().equals(bIFileArray[n].getFilePath().getBody())) {
filePath2 = BFileSystem.INSTANCE.findFile(filePath);
if (filePath2 != null) {
filePath2.delete();
}
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyFile", new Object[]{bIFileArray[n].getFilePath().getBody()}));
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
if (filePath.depth() > 0) {
BFileSystem.INSTANCE.makeDir(filePath.getParent(), null);
}
if (bl) {
BFileSystem.INSTANCE.move(bIFileArray[n].getFilePath(), filePath);
} else {
BIFile bIFile = BFileSystem.INSTANCE.makeFile(filePath);
FileUtil.pipe((BIFile)bIFileArray[n], (BIFile)bIFile);
}
this.notifyRegistration(bInstallable);
}
}
++n;
}
if (bl && !bDirectory.getFilePath().getBody().equals(INBOX_PATH.getBody())) {
bDirectory.delete();
}
}
private final String getNormalFileName(BInstallable bInstallable, BIFile bIFile) {
SlotCursor slotCursor = bInstallable.getParts().getProperties();
Class clazz = class$com$tridium$install$part$BPart;
if (clazz == null) {
clazz = class$com$tridium$install$part$BPart = LocalInstallableRegistry.class("[Lcom.tridium.install.part.BPart;", false);
}
if (slotCursor.next(clazz)) {
BPart bPart = (BPart)slotCursor.get();
return bPart.getPartName() + '.' + bIFile.getExtension();
}
return bIFile.getFileName();
}
private final Array getVersionSubdirs() {
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(SW_PATH);
Array array = new Array((Object[])bDirectory.listFiles());
array = array.filter(new IFilter(){
public final boolean accept(Object object) {
if (object == null || !(object instanceof BDirectory)) {
return false;
}
try {
new Version(((BDirectory)object).getFileName());
return true;
}
catch (Exception exception) {
return false;
}
}
});
return array.sort(new Comparator(){
public final int compare(Object object, Object object2) {
Version version;
String string = ((BDirectory)object).getFileName();
String string2 = ((BDirectory)object2).getFileName();
Version version2 = new Version(string2);
int n = version2.compareTo((Object)(version = new Version(string)));
return n == 0 ? string2.compareTo(string) : n;
}
});
}
public BInstallable findInstallable(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
this.init(daemonSessionTaskListener);
return this.installableCache.getInstallable(this.findInstallableFile(bDependency, daemonSessionTaskListener), daemonSessionTaskListener);
}
public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
this.init(daemonSessionTaskListener);
return new InstallableFileCursor(this.findInstallableFiles(bDependency, daemonSessionTaskListener), this.installableCache, daemonSessionTaskListener);
}
public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
this.init(daemonSessionTaskListener);
BIFile[] bIFileArray = this.findInstallableFiles(bDependency, daemonSessionTaskListener);
Class clazz = class$com$tridium$install$installable$BInstallable;
if (clazz == null) {
clazz = class$com$tridium$install$installable$BInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BInstallable;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < bIFileArray.length) {
BInstallable bInstallable = this.installableCache.getInstallable(bIFileArray[n], daemonSessionTaskListener);
if (bInstallable != null) {
array.add((Object)bInstallable);
}
++n;
}
return (BInstallable[])array.trim();
}
private static final boolean matchesDepend(BIFile bIFile, BDependency bDependency, PatternFilter[] patternFilterArray) {
if (bIFile == null) {
return false;
}
String string = bIFile.getExtension();
if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST) ? !"jar".equals(string) && !"sjar".equals(string) : !"dist".equals(string) && LocalInstallableRegistry.getInstance().getInstallableTypeForExt(string) == null) {
return false;
}
String string2 = bIFile.getFileName().substring(0, bIFile.getFileName().length() - string.length() - 1);
int n = 0;
while (n < patternFilterArray.length) {
if (patternFilterArray[n].accept(string2)) {
return true;
}
++n;
}
return false;
}
private static final String[] getFixedFileNames(BDependency bDependency) {
if (BPart.isWildcardName(bDependency.getPartName())) {
return new String[0];
}
if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST)) {
return new String[]{bDependency.getPartName() + ".jar", bDependency.getPartName() + ".sjar"};
}
return new String[]{bDependency.getPartName() + ".dist"};
}
public BIFile findInstallableFile(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
block14: {
String[] stringArray;
PatternFilter[] patternFilterArray;
block12: {
FilePath filePath;
block13: {
this.init(daemonSessionTaskListener);
patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName());
stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency);
if (bDependency.getVersionRelation() != BVersionRelation.exact) break block12;
filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString());
if (stringArray.length != 0) break block13;
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath);
if (bDirectory == null) break block14;
BIFile[] bIFileArray = bDirectory.listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) {
return bIFileArray[n];
}
++n;
}
break block14;
}
int n = 0;
while (n < stringArray.length) {
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n]));
if (bIFile != null) {
return bIFile;
}
++n;
}
break block14;
}
Array array = this.getVersionSubdirs();
int n = 0;
while (n < array.size()) {
BDirectory bDirectory = (BDirectory)array.get(n);
Version version = new Version(bDirectory.getFileName());
if (BVersion.meets(version, bDependency)) {
if (stringArray.length == 0) {
BIFile[] bIFileArray = bDirectory.listFiles();
int n2 = 0;
while (n2 < bIFileArray.length) {
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) {
return bIFileArray[n2];
}
++n2;
}
} else {
int n3 = 0;
while (n3 < stringArray.length) {
BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]);
if (bIFile != null) {
return bIFile;
}
++n3;
}
}
}
++n;
}
}
return null;
}
public BIFile[] findInstallableFiles(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
Array array;
block13: {
String[] stringArray;
PatternFilter[] patternFilterArray;
block15: {
FilePath filePath;
block16: {
this.init(daemonSessionTaskListener);
patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName());
stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency);
Class clazz = class$javax$baja$file$BIFile;
if (clazz == null) {
clazz = class$javax$baja$file$BIFile = LocalInstallableRegistry.class("[Ljavax.baja.file.BIFile;", false);
}
array = new Array(clazz);
if (bDependency.getVersionRelation() != BVersionRelation.exact) break block15;
filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString());
if (stringArray.length != 0) break block16;
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath);
if (bDirectory == null) break block13;
BIFile[] bIFileArray = bDirectory.listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) {
array.add((Object)bIFileArray[n]);
}
++n;
}
break block13;
}
int n = 0;
while (n < stringArray.length) {
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n]));
if (bIFile != null) {
array.add((Object)bIFile);
break block13;
}
++n;
}
break block13;
}
Array array2 = this.getVersionSubdirs();
int n = 0;
while (n < array2.size()) {
BDirectory bDirectory = (BDirectory)array2.get(n);
Version version = new Version(bDirectory.getFileName());
if (BVersion.meets(version, bDependency)) {
if (stringArray.length == 0) {
BIFile[] bIFileArray = bDirectory.listFiles();
int n2 = 0;
while (n2 < bIFileArray.length) {
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) {
array.add((Object)bIFileArray[n2]);
}
++n2;
}
} else {
int n3 = 0;
while (n3 < stringArray.length) {
BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]);
if (bIFile != null) {
array.add((Object)bIFile);
break;
}
++n3;
}
}
}
++n;
}
}
return (BIFile[])array.trim();
}
public BInstallable findInstallable(String string, Version version, Type type, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
if (string.indexOf(46) > 0) {
string = string.substring(0, string.indexOf(46));
}
if (version.isNull()) {
return this.findInstallable(new BDependency(string, BVersion.ZERO, BVersionRelation.minimum, type.getTypeSpec()), daemonSessionTaskListener);
}
return this.findInstallable(new BDependency(string, new BVersion(version.toString()), BVersionRelation.exact, type.getTypeSpec()), daemonSessionTaskListener);
}
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
return this.getInstallables(bl, daemonSessionTaskListener, null, null);
}
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string) throws Exception {
return this.getInstallables(bl, daemonSessionTaskListener, string, null);
}
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string, String string2) throws Exception {
this.init(daemonSessionTaskListener);
return new InstallableCursor(bl, daemonSessionTaskListener, FilenameFilterUtil.make(string, string2));
}
public void addListener(RegistryListener registryListener) {
this.listeners.add((Object)registryListener);
}
public void removeListener(RegistryListener registryListener) {
this.listeners.remove((Object)registryListener);
}
private final void notifyRegistration(BInstallable bInstallable) {
if (bInstallable == null) {
return;
}
int n = 0;
while (n < this.listeners.size()) {
try {
((RegistryListener)this.listeners.get(n)).installableRegistered(bInstallable);
}
catch (Exception exception) {
exception.printStackTrace();
}
++n;
}
}
public void registerInstallableFileType(String string, Type type) {
this.installableTypesByFileExt.put(string, type);
}
public Type getInstallableTypeForExt(String string) {
return (Type)this.installableTypesByFileExt.get(string);
}
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());
}
}
private final /* synthetic */ void this() {
this.initialized = false;
this.installableCache = null;
this.initializing = false;
Class clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener;
if (clazz == null) {
clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.LocalInstallableRegistry$RegistryListener;", false);
}
this.listeners = new Array(clazz);
this.installableTypesByFileExt = new HashMap();
}
private LocalInstallableRegistry() {
this.this();
}
private static class InstallableCache {
private TreeSet pathsNotFound = new TreeSet(FilePathComparator.INSTANCE);
private TreeMap instByPath = new TreeMap(FilePathComparator.INSTANCE);
public void register(BIFile bIFile, BInstallable bInstallable) {
this.register(bIFile.getFilePath(), bInstallable);
}
public void register(FilePath filePath, BInstallable bInstallable) {
this.pathsNotFound.remove(filePath);
this.instByPath.put(filePath, bInstallable);
}
public BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener) {
return this.getInstallable(bIFile, daemonSessionTaskListener, null);
}
/*
* 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 BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask) {
BInstallable bInstallable;
block9: {
if (bIFile == null) {
return null;
}
if (this.pathsNotFound.contains(bIFile.getFilePath())) {
return null;
}
bInstallable = (BInstallable)this.instByPath.get(bIFile.getFilePath());
if (bInstallable != null) return bInstallable;
if (daemonSessionTaskListener == null) {
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
}
boolean bl = false;
if (daemonSessionTask == null) {
daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.parse.genericTitle", "LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()});
daemonSessionTaskListener.taskStarted(daemonSessionTask);
bl = true;
} else {
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()}));
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
}
try {
bInstallable = BInstallable.make(bIFile);
}
catch (Throwable throwable) {
Object var7_7 = null;
if (!bl) throw throwable;
daemonSessionTaskListener.taskFinished(daemonSessionTask);
throw throwable;
}
{
Object var7_8 = null;
if (bl) {
daemonSessionTaskListener.taskFinished(daemonSessionTask);
}
if (bInstallable != null) break block9;
this.pathsNotFound.add(bIFile.getFilePath());
}
return bInstallable;
}
this.instByPath.put(bIFile.getFilePath(), bInstallable);
return bInstallable;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
protected static class InstallableFileCursor
implements ClosableCursor {
private BIFile[] files;
private int index;
private InstallableCache cache;
private DaemonSessionTaskListener listener;
static /* synthetic */ Class class$javax$baja$sys$BComponent;
public void close() {
}
public BObject get() {
if (this.index < 0 || this.index >= this.files.length) {
return null;
}
return this.cache.getInstallable(this.files[this.index], this.listener);
}
public Context getContext() {
return null;
}
public boolean next() {
if (this.index < this.files.length - 1) {
++this.index;
return true;
}
return false;
}
public boolean next(Class clazz) {
boolean bl = this.next();
while (bl && !clazz.isAssignableFrom(this.get().getClass())) {
bl = this.next();
}
return bl;
}
public boolean nextComponent() {
Class clazz = class$javax$baja$sys$BComponent;
if (clazz == null) {
clazz = class$javax$baja$sys$BComponent = InstallableFileCursor.class("[Ljavax.baja.sys.BComponent;", false);
}
return this.next(clazz);
}
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 InstallableFileCursor(BIFile[] bIFileArray, InstallableCache installableCache, DaemonSessionTaskListener daemonSessionTaskListener) {
this.files = bIFileArray;
this.index = -1;
this.cache = installableCache;
this.listener = daemonSessionTaskListener;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class InstallableCursor
implements ClosableCursor {
BInstallable current;
Iterator iterator;
DaemonSessionTaskListener listener;
IFilter fileNameFilter;
public Context getContext() {
return null;
}
public void close() {
}
public boolean next() {
while (this.iterator.hasNext()) {
FilePath filePath = (FilePath)this.iterator.next();
if (!this.fileNameFilter.accept((Object)filePath)) continue;
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
if (this.current == null) continue;
return true;
}
return false;
}
public boolean nextComponent() {
Class clazz = class$javax$baja$sys$BComponent;
if (clazz == null) {
clazz = class$javax$baja$sys$BComponent = LocalInstallableRegistry.class("[Ljavax.baja.sys.BComponent;", false);
}
return this.next(clazz);
}
public boolean nextDist() {
while (this.iterator.hasNext()) {
FilePath filePath = (FilePath)this.iterator.next();
if (!this.fileNameFilter.accept((Object)filePath) || !"dist".equals(FileUtil.getExtension((String)filePath.getName()))) continue;
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
if (this.current == null) continue;
return true;
}
return false;
}
public boolean nextModule() {
while (this.iterator.hasNext()) {
FilePath filePath = (FilePath)this.iterator.next();
if (!this.fileNameFilter.accept((Object)filePath) || !"jar".equals(FileUtil.getExtension((String)filePath.getName())) && !"sjar".equals(FileUtil.getExtension((String)filePath.getName())) && LocalInstallableRegistry.this.getInstallableTypeForExt(FileUtil.getExtension((String)filePath.getName())) == null) continue;
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
if (this.current == null) continue;
return true;
}
return false;
}
/*
* Unable to fully structure code
*/
public boolean next(Class var1_1) {
block6: {
block5: {
v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable;
if (v0 == null) {
v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
}
if (!v0.isAssignableFrom(var1_1)) break block5;
while (this.nextModule()) {
if (!var1_1.isInstance(this.current)) continue;
return true;
}
break block6;
}
v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution;
if (v1 == null) {
v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BDistribution;", false);
}
if (!v1.isAssignableFrom(var1_1)) ** GOTO lbl20
while (this.nextDist()) {
if (!var1_1.isInstance(this.current)) continue;
return true;
}
break block6;
lbl-1000:
// 1 sources
{
if (!var1_1.isInstance(this.current)) continue;
return true;
lbl20:
// 2 sources
** while (this.next())
}
}
return false;
}
public BObject get() {
return this.current;
}
private final /* synthetic */ void this() {
this.current = null;
}
public InstallableCursor(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, IFilter iFilter) {
this.this();
Class clazz = class$javax$baja$file$FilePath;
if (clazz == null) {
clazz = class$javax$baja$file$FilePath = LocalInstallableRegistry.class("[Ljavax.baja.file.FilePath;", false);
}
Array array = new Array(clazz);
HashSet<String> hashSet = new HashSet<String>();
Array array2 = LocalInstallableRegistry.this.getVersionSubdirs();
this.fileNameFilter = iFilter;
this.listener = daemonSessionTaskListener == null ? DaemonSessionTaskListener.NULL_TASK_LISTENER : daemonSessionTaskListener;
int n = 0;
while (n < array2.size()) {
BIFile[] bIFileArray = ((BDirectory)array2.get(n)).listFiles();
int n2 = 0;
while (n2 < bIFileArray.length) {
FilePath filePath = bIFileArray[n2].getFilePath();
String string = FileUtil.getExtension((String)filePath.getName());
if (!(!"dist".equals(string) && !"jar".equals(string) && !"sjar".equals(string) && LocalInstallableRegistry.this.getInstallableTypeForExt(string) == null || bl && hashSet.contains(filePath.getName()))) {
array.add((Object)filePath);
hashSet.add(filePath.getName());
}
++n2;
}
++n;
}
this.iterator = array.iterator();
}
}
public static interface RegistryListener {
public void installableRegistered(BInstallable var1);
}
}
@@ -0,0 +1,528 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
* javax.baja.sys.BAbsTime
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.xml.XContent
* javax.baja.xml.XElem
* javax.baja.xml.XParser
* javax.baja.xml.XWriter
*/
package com.tridium.install.installable;
import com.tridium.install.BDependency;
import com.tridium.install.BVersion;
import com.tridium.install.part.BModulePart;
import com.tridium.install.part.BModuleStatus;
import com.tridium.platform.daemon.BModuleContent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.ListIterator;
import javax.baja.nre.util.Array;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
import javax.baja.xml.XWriter;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class ModuleManifest {
private XElem moduleElement;
private HashMap typeByName;
private Array types;
private Array unknownElements;
private HashMap dependencyByName;
private HashMap moduleContentByPath;
private XElem exclElement;
private BModuleStatus status;
private boolean noRunningStation;
static /* synthetic */ Class class$javax$baja$xml$XElem;
static /* synthetic */ Class class$com$tridium$install$BDependency;
public static ModuleManifest make(XElem xElem) {
return xElem == null ? null : new ModuleManifest(xElem);
}
public static ModuleManifest make(InputStream inputStream) {
return ModuleManifest.make(inputStream, true);
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public static ModuleManifest make(InputStream inputStream, boolean bl) {
ModuleManifest moduleManifest;
block15: {
ModuleManifest moduleManifest2;
block14: {
ModuleManifest moduleManifest3;
block13: {
try {
try {
XParser xParser = XParser.make((InputStream)inputStream);
if (xParser.next() == -1) {
moduleManifest3 = new ModuleManifest(BModuleStatus.corrupt);
Object var3_8 = null;
if (!bl) return moduleManifest3;
break block13;
}
if (xParser.type() == 1 && xParser.elem().name().equals("module")) {
moduleManifest2 = new ModuleManifest(xParser.elem(), xParser);
break block14;
}
moduleManifest = new ModuleManifest(BModuleStatus.corrupt);
break block15;
}
catch (Exception exception) {
ModuleManifest moduleManifest4 = new ModuleManifest(BModuleStatus.corrupt);
Object var3_11 = null;
if (!bl) return moduleManifest4;
try {
inputStream.close();
return moduleManifest4;
}
catch (IOException iOException) {}
return moduleManifest4;
}
}
catch (Throwable throwable) {
Object var3_12 = null;
if (!bl) throw throwable;
try {}
catch (IOException iOException) {
throw throwable;
}
inputStream.close();
throw throwable;
}
}
try {}
catch (IOException iOException) {}
inputStream.close();
return moduleManifest3;
}
Object var3_9 = null;
if (!bl) return moduleManifest2;
try {}
catch (IOException iOException) {}
inputStream.close();
return moduleManifest2;
}
Object var3_10 = null;
if (!bl) return moduleManifest;
try {}
catch (IOException iOException) {}
inputStream.close();
return moduleManifest;
}
public void write(OutputStream outputStream) throws Exception {
this.write(this.getModuleContent(), outputStream);
}
public void write(BModuleContent bModuleContent, OutputStream outputStream) {
try {
Object object;
BModuleContent bModuleContent2;
Object object2;
XWriter xWriter = new XWriter(outputStream);
xWriter.prolog();
XElem xElem = this.moduleElement.copy();
xElem.addAttr("archiveDate", String.valueOf(new Date()));
xElem.addAttr("archiveInstall", bModuleContent.getTag());
try {
xElem.addAttr("archiveHost", Sys.getLocalHost().getHostName());
}
catch (Exception exception) {}
XElem xElem2 = new XElem("dependencies");
XElem xElem3 = null;
XElem xElem4 = null;
XElem xElem5 = this.dependencyByName.values().iterator();
while (xElem5.hasNext()) {
try {
object2 = (BDependency)((Object)xElem5.next());
if (((BDependency)((Object)object2)).getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec())) {
xElem2.addContent((XContent)((BDependency)((Object)object2)).getXml());
continue;
}
if (xElem3 == null) {
xElem3 = new XElem("installation");
}
if (xElem4 == null) {
xElem4 = new XElem("dependencies");
xElem3.addContent((XContent)xElem4);
}
xElem4.addContent((XContent)((BDependency)((Object)object2)).getXml());
}
catch (Exception exception) {
exception.printStackTrace();
}
}
xElem.addContent((XContent)xElem2);
if (this.noRunningStation) {
if (xElem3 == null) {
xElem3 = new XElem("installation");
}
xElem3.addAttr("noRunningStation", "true");
}
if (this.exclElement != null) {
if (xElem3 == null) {
xElem3 = new XElem("installation");
}
xElem3.addContent((XContent)this.exclElement.copy());
}
if (xElem3 != null) {
xElem.addContent((XContent)xElem3);
}
xElem5 = null;
object2 = this.moduleContentByPath.keySet().iterator();
while (object2.hasNext()) {
try {
String string = (String)object2.next();
bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string));
object = new XElem("dir");
object.addAttr("name", string);
object.addAttr("install", bModuleContent2.getTag());
if (bModuleContent.getOrdinal() < bModuleContent2.getOrdinal()) {
object.addAttr("stripped", "true");
}
if (xElem5 == null) {
xElem5 = new XElem("dirs");
}
xElem5.addContent((XContent)object);
}
catch (Exception exception) {
exception.printStackTrace();
}
}
if (xElem5 != null) {
xElem.addContent(xElem5);
}
object2 = null;
int n = 0;
while (n < this.types.size()) {
bModuleContent2 = (XElem)this.types.get(n);
object = bModuleContent2.get("class").replace('.', '/');
if (this.includePath((String)(object = ((String)object).substring(0, ((String)object).lastIndexOf(47))), bModuleContent)) {
if (object2 == null) {
object2 = new XElem("types");
}
object2.addContent((XContent)bModuleContent2.copy());
}
++n;
}
if (object2 != null) {
xElem.addContent((XContent)object2);
}
ListIterator listIterator = this.unknownElements.iterator();
while (listIterator.hasNext()) {
xElem.addContent((XContent)((XElem)listIterator.next()).copy());
}
xElem.write(xWriter);
xWriter.flush();
}
catch (Exception exception) {
throw new LocalizableRuntimeException("platform", "ModulePart.exception.writeXml", (Throwable)exception);
}
}
public String getArchiveDate() {
return this.moduleElement.get("archiveDate", "");
}
public String getArchiveHost() {
return this.moduleElement.get("archiveHost", "");
}
public BAbsTime getBuildAbsTime() {
String string = this.moduleElement.get("buildMillis", null);
if (string == null) {
return BAbsTime.NULL;
}
long l = Long.parseLong(string);
return BAbsTime.make((long)l);
}
public String getBuildDate() {
return this.moduleElement.get("buildDate", "");
}
public String getBuildHost() {
return this.moduleElement.get("buildHost", "");
}
public BDependency[] getDependencies() {
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
Iterator iterator = this.dependencyByName.values().iterator();
while (iterator.hasNext()) {
array.add(iterator.next());
}
return (BDependency[])array.trim();
}
public BDependency getDependency(String string) {
return (BDependency)((Object)this.dependencyByName.get(string));
}
public String getDescription() {
return this.moduleElement.get("description", "");
}
public BDependency[] getExclusions() {
if (this.exclElement == null) {
return new BDependency[0];
}
XElem[] xElemArray = this.exclElement.elems();
Class clazz = class$com$tridium$install$BDependency;
if (clazz == null) {
clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < xElemArray.length) {
BDependency bDependency = BDependency.make(xElemArray[n]);
if (bDependency != null) {
array.add((Object)bDependency);
}
++n;
}
return (BDependency[])array.trim();
}
public BModuleContent getModuleContent() {
return BModuleContent.make(this.moduleElement.get("archiveInstall", "doc"));
}
public BModuleContent getModuleContentForPath(String string) {
return this.getModuleContentForPath(string, this.getModuleContent());
}
public BModuleContent getModuleContentForPath(String string, BModuleContent bModuleContent) {
BModuleContent bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string));
return bModuleContent2 == null ? bModuleContent : bModuleContent2;
}
public String getName() {
return this.moduleElement.get("name");
}
public String getPreferredSymbol() {
return this.moduleElement.get("preferredSymbol", "");
}
public BModuleStatus getStatus() {
return this.status;
}
public BVersion getVersion() {
return new BVersion(this.moduleElement.get("vendor", ""), this.moduleElement.get("vendorVersion", this.moduleElement.get("version", "0")));
}
public boolean includePath(String string, BModuleContent bModuleContent) {
boolean bl;
BModuleContent bModuleContent2 = string.startsWith("doc/") ? BModuleContent.doc : this.getModuleContentForPath(string, null);
if (bModuleContent2 == null) {
bl = true;
} else {
boolean bl2 = false;
if (bModuleContent.getOrdinal() >= bModuleContent2.getOrdinal()) {
bl2 = true;
}
bl = bl2;
}
return bl;
}
public boolean noRunningStation() {
return this.noRunningStation;
}
public void setNoRunningStation(boolean bl) {
this.noRunningStation = bl;
}
public boolean isInstallable() {
return this.moduleElement.getb("installable", true);
}
public boolean isNreModule() {
boolean bl = false;
if (this.moduleElement.getb("nre", true) && this.isInstallable()) {
bl = true;
}
return bl;
}
private final boolean loadManifestHeader(XElem xElem) {
if (!xElem.name().equals("module")) {
this.status = BModuleStatus.misnamed;
return false;
}
this.moduleElement = xElem.copy();
this.moduleElement.clearContent();
return true;
}
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());
}
}
private final /* synthetic */ void this() {
this.moduleElement = null;
this.typeByName = new HashMap();
Class clazz = class$javax$baja$xml$XElem;
if (clazz == null) {
clazz = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false);
}
this.types = new Array(clazz);
Class clazz2 = class$javax$baja$xml$XElem;
if (clazz2 == null) {
clazz2 = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false);
}
this.unknownElements = new Array(clazz2);
this.dependencyByName = new HashMap();
this.moduleContentByPath = new HashMap();
this.exclElement = null;
this.status = null;
this.noRunningStation = false;
}
private ModuleManifest(XElem xElem) {
this.this();
if (!this.loadManifestHeader(xElem)) {
return;
}
try {
XElem[] xElemArray = xElem.elems();
int n = 0;
while (n < xElemArray.length) {
XElem xElem2;
if (xElemArray[n].name().equals("dirs")) {
xElem2 = xElemArray[n].elems("dir");
int n2 = 0;
while (n2 < ((XElem[])xElem2).length) {
this.moduleContentByPath.put(xElem2[n2].get("name"), BModuleContent.make(xElem2[n2].get("install", "doc")));
++n2;
}
} else if (xElemArray[n].name().equals("dependencies")) {
xElem2 = xElemArray[n].elems("dependency");
int n3 = 0;
while (n3 < ((XElem[])xElem2).length) {
this.dependencyByName.put(xElem2[n3].get("name"), BDependency.make(xElem2[n3]));
++n3;
}
} else if (xElemArray[n].name().equals("types")) {
xElem2 = xElemArray[n].elems("type");
int n4 = 0;
while (n4 < ((XElem[])xElem2).length) {
this.typeByName.put(xElem2[n4].get("name"), xElem2[n4]);
this.types.add((Object)xElem2[n4]);
++n4;
}
} else if (xElemArray[n].name().equals("installation")) {
this.noRunningStation = xElemArray[n].getb("noRunningStation", this.getName().equals("baja"));
xElem2 = xElemArray[n].elem("dependencies");
this.exclElement = xElemArray[n].elem("exclusions");
if (xElem2 != null) {
XElem[] xElemArray2 = xElem2.elems();
int n5 = 0;
while (n5 < xElemArray2.length) {
BDependency bDependency = BDependency.make(xElemArray2[n5]);
if (bDependency != null) {
if (bDependency.getPartName().startsWith("nre-core") && xElemArray2[n5].get("solvers", null) == null) {
bDependency.setSolverFiltersString("commissioning");
}
this.dependencyByName.put(bDependency.getPartName(), bDependency);
}
++n5;
}
}
} else {
this.unknownElements.add((Object)xElemArray[n]);
}
++n;
}
this.status = BModuleStatus.ok;
}
catch (Exception exception) {
this.status = BModuleStatus.corrupt;
}
}
private ModuleManifest(XElem xElem, XParser xParser) throws Exception {
this.this();
if (this.loadManifestHeader(xElem)) {
while (xParser.next() != -1) {
Object object;
if (xParser.type() != 1) continue;
if (xParser.elem().name().equals("dir")) {
this.moduleContentByPath.put(xParser.elem().get("name"), BModuleContent.make(xParser.elem().get("install", "doc")));
continue;
}
if (xParser.elem().name().equals("dependency")) {
this.dependencyByName.put(xParser.elem().get("name"), BDependency.make(xParser.elem()));
continue;
}
if (xParser.elem().name().equals("exclusions")) {
this.exclElement = xParser.parseCurrent(false);
continue;
}
if (xParser.depth() > 1 && xParser.elem(xParser.depth() - 2).name().equals("dependencies")) {
object = BDependency.make(xParser.elem());
if (object == null) continue;
if (object.getPartName().startsWith("nre-core") && xParser.elem().get("solvers", null) == null) {
object.setSolverFiltersString("commissioning");
}
this.dependencyByName.put(object.getPartName(), object);
continue;
}
if (xParser.elem().name().equals("type")) {
object = xParser.parseCurrent(false);
this.typeByName.put(xParser.elem().get("name"), object);
this.types.add(object);
continue;
}
if (xParser.elem().name().equals("installation")) {
this.noRunningStation = xParser.elem().getb("noRunningStation", this.getName().equals("baja"));
continue;
}
if (xParser.elem().name().equals("types") || xParser.elem().name().equals("dependencies") || xParser.elem().name().equals("dirs") || xParser.depth() != 2) continue;
this.unknownElements.add((Object)xParser.parseCurrent(false));
}
this.status = BModuleStatus.ok;
}
}
private ModuleManifest(BModuleStatus bModuleStatus) {
this.this();
this.status = bModuleStatus;
}
}