147 lines
4.3 KiB
Java
147 lines
4.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.file.BIFile
|
|
* javax.baja.sys.BSingleton
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
*/
|
|
package javax.baja.platform.install;
|
|
|
|
import java.io.InputStream;
|
|
import javax.baja.file.BIFile;
|
|
import javax.baja.sys.BSingleton;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public abstract class BFileReconciler
|
|
extends BSingleton {
|
|
public static final Type TYPE;
|
|
public static final ReconciliationResults NO_RECONCILIATION;
|
|
static /* synthetic */ Class class$javax$baja$platform$install$BFileReconciler;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public abstract ReconciliationResults reconcile(BIFile var1, BIFile var2) throws Exception;
|
|
|
|
public final ReconciliationResults reconcile(BIFile bIFile, long l, BIFile bIFile2, long l2) throws Exception {
|
|
if (bIFile == null || l == l2 && l != (long)-1) {
|
|
return NO_RECONCILIATION;
|
|
}
|
|
if (bIFile2 == null) {
|
|
return new FileReconciliationResults(bIFile);
|
|
}
|
|
return new LazyReconciliationResults(bIFile, bIFile2);
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$platform$install$BFileReconciler;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$platform$install$BFileReconciler = BFileReconciler.class("[Ljavax.baja.platform.install.BFileReconciler;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
NO_RECONCILIATION = new ReconciliationResults(){
|
|
|
|
public final InputStream getInputStream() throws Exception {
|
|
throw new IllegalStateException();
|
|
}
|
|
|
|
public final long getSize() throws Exception {
|
|
throw new IllegalStateException();
|
|
}
|
|
|
|
public final boolean shouldReplaceContents() {
|
|
return false;
|
|
}
|
|
};
|
|
}
|
|
|
|
public static class FileReconciliationResults
|
|
implements ReconciliationResults {
|
|
private BIFile file;
|
|
|
|
public InputStream getInputStream() throws Exception {
|
|
return this.file.getInputStream();
|
|
}
|
|
|
|
public long getSize() throws Exception {
|
|
return this.file.getSize();
|
|
}
|
|
|
|
public boolean shouldReplaceContents() {
|
|
return true;
|
|
}
|
|
|
|
public FileReconciliationResults(BIFile bIFile) {
|
|
this.file = bIFile;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
protected class LazyReconciliationResults
|
|
implements ReconciliationResults {
|
|
private ReconciliationResults results;
|
|
private BIFile newContents;
|
|
private BIFile existingContents;
|
|
|
|
public InputStream getInputStream() throws Exception {
|
|
return this.results().getInputStream();
|
|
}
|
|
|
|
public long getSize() throws Exception {
|
|
return this.results().getSize();
|
|
}
|
|
|
|
public boolean shouldReplaceContents() throws Exception {
|
|
return this.results().shouldReplaceContents();
|
|
}
|
|
|
|
private final ReconciliationResults results() throws Exception {
|
|
if (this.results == null) {
|
|
this.results = BFileReconciler.this.reconcile(this.newContents, this.existingContents);
|
|
}
|
|
return this.results;
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.results = null;
|
|
}
|
|
|
|
public LazyReconciliationResults(BIFile bIFile, BIFile bIFile2) {
|
|
this.this();
|
|
this.newContents = bIFile;
|
|
this.existingContents = bIFile2;
|
|
}
|
|
}
|
|
|
|
public static interface ReconciliationResults {
|
|
public InputStream getInputStream() throws Exception;
|
|
|
|
public long getSize() throws Exception;
|
|
|
|
public boolean shouldReplaceContents() throws Exception;
|
|
}
|
|
}
|
|
|