All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testvagrant.optimuscloud.driver.SessionManager Maven / Gradle / Ivy

Go to download

The Java Client provides access to Optimus cloud for all java based projects.

There is a newer version: 1.1.0
Show newest version
package com.testvagrant.optimuscloud.driver;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class SessionManager {

    private HttpURLConnection httpURLConnection;
    private URL url;

    public boolean isSessionUp(String sessionUrl) {
        try {
            URL url = new URL(sessionUrl);
            httpURLConnection = (HttpURLConnection) url.openConnection();
            httpURLConnection.setRequestMethod("HEAD");
            int code = httpURLConnection.getResponseCode();
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy