public boolean isConnected()

in src/main/java/com/revo/deployr/client/broker/engine/RBrokerEngine.java [409:446]


    public boolean isConnected() {

        boolean connected = false;

        if (rUser != null) {
            /*
             * Test connection to authenticated
             * HTTP session on server.
             */
            try {
                rUser.autosaveProjects(false);
                connected = true;
            } catch (Exception ex) {
            }

        } else {
            /*
             * Test connection to server.
             */
            URL dURL = null;
            InputStream dIn = null;
            try {
                dURL = new URL(brokerConfig.deployrEndpoint);
                URLConnection dConn = dURL.openConnection();
                dIn = dConn.getInputStream();
                connected = true;
            } catch (Exception ex) {
            } finally {
                if (dIn != null) {
                    try {
                        dIn.close();
                    } catch (Exception cex) {
                    }
                }
            }
        }
        return connected;
    }