public int getResponseCode() throws IOException {
        int code = 0;

        try {
            code = con.getResponseCode();
        }
        catch (FileNotFoundException fnfex) {
            code = HttpConnection.HTTP_NOT_FOUND;
        }
        catch (IOException ioex) {
            if (ioex.getMessage().startsWith("file not found")) {
                code = HttpConnection.HTTP_NOT_FOUND;
            }
            else {
                throw ioex;
            }
        }

        return code;
    }