/* * Decompiled with CFR 0.152. * * Could not load the following classes: * javax.baja.sys.Property * javax.baja.sys.Sys * javax.baja.sys.Type * javax.baja.web.BWebServlet * javax.baja.web.WebOp * javax.servlet.ServletOutputStream */ package com.tridium.platform.hx; import com.tridium.platform.daemon.BDaemonSession; import com.tridium.platform.daemon.BStationSurrogate; import com.tridium.platform.daemon.LocalSessionUtil; import java.io.EOFException; import java.io.InputStream; import java.io.InterruptedIOException; import javax.baja.sys.Property; import javax.baja.sys.Sys; import javax.baja.sys.Type; import javax.baja.web.BWebServlet; import javax.baja.web.WebOp; import javax.servlet.ServletOutputStream; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BStationOutputServlet extends BWebServlet { public static final Property servletName = BStationOutputServlet.newProperty((int)0, (String)"stationOutput", null); public static final Type TYPE; static /* synthetic */ Class class$com$tridium$platform$hx$BStationOutputServlet; public Type getType() { return TYPE; } public Type[] getServiceTypes() { return new Type[]{TYPE}; } /* * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation */ public void doGet(WebOp webOp) throws Exception { BDaemonSession bDaemonSession = LocalSessionUtil.getLocalSession(); webOp.setContentType("text/plain"); if (bDaemonSession == null) { webOp.getWriter().println(this.getLexicon().getText("StationOutputServlet.notAvailable")); return; } ServletOutputStream servletOutputStream = webOp.getResponse().getOutputStream(); BStationSurrogate bStationSurrogate = BStationSurrogate.make(bDaemonSession, Sys.getStation().getStationName()); InputStream inputStream = bStationSurrogate.getStationOutput(false, false); try { int n = 4096; byte[] byArray = new byte[n]; while (true) { int n2; block14: { n2 = inputStream.read(byArray, 0, n); if (n2 >= 0) break block14; Object var7_10 = null; try { inputStream.close(); return; } catch (Exception exception) {} return; } try { if (n2 > 0) { servletOutputStream.write(byArray, 0, n2); } } catch (InterruptedIOException interruptedIOException) { } catch (EOFException eOFException) { Object var7_11 = null; try {} catch (Exception exception) {} inputStream.close(); return; } continue; break; } } catch (Throwable throwable) { Object var7_12 = null; try {} catch (Exception exception) {} inputStream.close(); throw throwable; throw throwable; } } 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$com$tridium$platform$hx$BStationOutputServlet; if (clazz == null) { clazz = class$com$tridium$platform$hx$BStationOutputServlet = BStationOutputServlet.class("[Lcom.tridium.platform.hx.BStationOutputServlet;", false); } TYPE = Sys.loadType((Class)clazz); } }