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

85 lines
2.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package com.tridium.util.jar;
import com.tridium.util.jar.JarFile;
import com.tridium.util.jar.JarURLStreamHandler;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.zip.ZipEntry;
public class JarEntry
extends ZipEntry {
JarFile jarFile;
ZipEntry entry;
public String getName() {
return this.entry.getName();
}
public long getSize() {
return this.entry.getSize();
}
public long getTime() {
return this.entry.getTime();
}
public InputStream getInputStream() throws IOException {
return this.jarFile.zip.getInputStream(this.entry);
}
/*
* 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 byte[] read() throws IOException {
int n = (int)this.getSize();
byte[] byArray = new byte[n];
InputStream inputStream = this.getInputStream();
try {
int n2 = 0;
while (n2 < n) {
int n3 = inputStream.read(byArray, n2, n - n2);
if (n3 < 0) {
throw new IOException("Unexpected EOF");
}
n2 += n3;
}
}
catch (Throwable throwable) {
Object var5_7 = null;
inputStream.close();
throw throwable;
}
{
Object var5_8 = null;
}
inputStream.close();
return byArray;
}
public URL getURL() {
try {
String string = this.jarFile.url + "!/" + this.getName();
return new URL("jar", "", -1, string, new JarURLStreamHandler(this));
}
catch (MalformedURLException malformedURLException) {
malformedURLException.printStackTrace();
return null;
}
}
public JarEntry(JarFile jarFile, ZipEntry zipEntry) {
super(zipEntry.getName());
this.jarFile = jarFile;
this.entry = zipEntry;
}
}