Package jsky.catalog

Examples of jsky.catalog.URLQueryResult


                    try {
                        URLConnection connection = _progressPanel.openConnection(queryUrl);
                        String contentType = connection.getContentType();
                        if (contentType != null && contentType.equals("text/html")) {
                            // might be an HTML error from the catalog server
                            return new URLQueryResult(queryUrl);
                        }
                        InputStream ins = connection.getInputStream();
                        in = _progressPanel.getLoggedInputStream(ins, connection.getContentLength());

                        SkycatTable cat = new SkycatTable(this, in, queryArgs);
View Full Code Here


                if (urlStr.startsWith(File.separator)) {
                    // may be a local command path name
                    throw new RuntimeException("Local commands not supported for image server (yet)");
                } else {
                    // normal URL
                    return new URLQueryResult(new URL(urlStr));
                }
            }
        }
        throw new RuntimeException("No query URL was specified in the config file.");
    }
View Full Code Here

     */
    private QueryResult _queryCatalogDirectory() {
        int numURLs = _entry.getNumURLs();
        for (int i = 0; i < numURLs; i++) {
            try {
                return new URLQueryResult(new URL(_entry.getURL(0)));
            } catch (Exception e) {
                if (i == (numURLs - 1))
                    throw new RuntimeException(e);
            }
        }
View Full Code Here

                    if (_queryComponent != null) {
                        navigator.setOrigURL(url);
                        navigator.setQueryComponent(_queryComponent);
                    } else if (url != null) {
                        navigator.setQueryResult(new URLQueryResult(url));
                    } else if (navigator instanceof CatalogNavigatorOpener) {
                        ((CatalogNavigatorOpener) navigator).openCatalogWindow(_name);
                    } else {
                        DialogUtil.error("Don't know how to display catalog");
                    }
View Full Code Here

        return null;
    }

    public URLQueryResult getLinkValue(TableQueryResult tableQueryResult,
                                       Object value, int row) throws MalformedURLException {
        URLQueryResult result;
        try {
            result = new URLQueryResult(new URL(value.toString()));
            result.setFormat(getLinkFormat(tableQueryResult, row));
            return result;
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

        _queryResult = queryResult;

        // Use a background thread for remote catalog access, local catalogs are handled in this thread
        boolean isLocal = true;
        if (queryResult instanceof URLQueryResult) {
            URLQueryResult uqr = (URLQueryResult) queryResult;
            URL url = uqr.getURL();
            isLocal = (url.getProtocol().equals("file"));
        } else if (queryResult instanceof Catalog) {
            isLocal = ((Catalog) queryResult).isLocal();
        }
        if (isLocal) {
View Full Code Here

     */
    public void open(String fileOrUrl) {
        try {
            setQueryComponent(new EmptyPanel());
            URL url = FileUtil.makeURL(null, fileOrUrl);
            URLQueryResult _queryResult = new URLQueryResult(url);
            setQueryResult(_queryResult);
        } catch (Exception e) {
            DialogUtil.error(e);
        }
    }
View Full Code Here

                url = new URL(urlStr);
            } catch (Exception e) {
                DialogUtil.error(e);
                return;
            }
            setQueryResult(new URLQueryResult(url));
        }
    }
View Full Code Here

                // A URL returned a catalog directory
                _displayQueryResult(_node, (CatalogDirectory) result);
            } else if (_queryResultDisplay != null) {
                // if the URL's content type was not recognized here, it may be something that the
                // QueryResultDisplay class knows how to display
                _queryResultDisplay.setQueryResult(new URLQueryResult(_url));
            }
        }
View Full Code Here

        URL queryUrl = _getQueryUrl(queryArgs);

        LOG.info("URL = " + queryUrl);

        if (_type.equals(IMAGE_SERVER)) {
            return new URLQueryResult(queryUrl);
        }

        if (_progressPanel == null) {
            _progressPanel = ProgressPanel.makeProgressPanel("Downloading query results ...");
        }
        ProgressBarFilterInputStream in = null;
        try {
            URLConnection connection = _progressPanel.openConnection(queryUrl);
            String contentType = connection.getContentType();
            if (contentType != null && contentType.equals("text/html")) {
                // might be an HTML error from the catalog server
                return new URLQueryResult(queryUrl);
            }
            InputStream ins = connection.getInputStream();
            in = _progressPanel.getLoggedInputStream(ins, connection.getContentLength());
            return _makeQueryResult(in, queryArgs);
        } finally {
View Full Code Here

TOP

Related Classes of jsky.catalog.URLQueryResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.