Package com.cloudhopper.commons.util

Examples of com.cloudhopper.commons.util.URL


     * Creates a new RemoteFileSystem by parsing the URL and creating the
     * correct underlying provider to support the protocol.
     */
    public static RemoteFileSystem create(String url) throws MalformedURLException, FileSystemException {
        // parse url into a URL object
        URL r = URLParser.parse(url);
        // delegate responsibility to other method
        return create(r);
    }
View Full Code Here


     * @param value
     * @throws MalformedURLException
     */
    public void addRemoteBroker(String value) throws MalformedURLException, IllegalArgumentException {
        // always parse the value into a URL
        URL url = URLParser.parse(value);
       
        // do we already have this URL?
        if (remoteBrokers.contains(url)) {
            throw new IllegalArgumentException("Duplicate URL [" + value + "] cannot be configured");
        }
View Full Code Here

     */
    static public DataStore create(String url) throws DataStoreFatalException {
        //
        // parse data store url
        //
        URL parsedUrl = null;

        try {
            parsedUrl = URLParser.parse(url);
        } catch (MalformedURLException e) {
            throw new DataStoreFatalException("Unable to parse URL: " + url, e);
        }

        //
        // the "host" is the data store "name"
        //
        String dataStoreName = parsedUrl.getHost();
        if (dataStoreName == null) {
            throw new DataStoreFatalException("The host portion of the DataStore URL needs to include the name of the DataStore");
        }

        //
        // convert url protocol to the underlying implementation
        //
        //DataStoreProtocol protocol = DataStoreProtocol.parseProtocol(parsedUrl.getProtocol());
        Class<? extends DataStore> dataStoreClass = providers.get(parsedUrl.getProtocol());

        if (dataStoreClass == null) {
            throw new DataStoreFatalException("Unable to load DataStore provider for '" + parsedUrl.getProtocol() + "'. Probably not a valid provider?");
        }

        DataStore ds = null;

        try {
            ds = dataStoreClass.newInstance();
        } catch (Exception e) {
            throw new DataStoreFatalException("Unable to load data store class '" + dataStoreClass + "'");
        }

        Properties props = parsedUrl.getQueryProperties();

        // create a temporary xml configuration in-memory to take advantage of
        // the ability for an Xbean to auto configure an object
        if (props != null) {
            StringBuilder xml = new StringBuilder(200);
View Full Code Here

TOP

Related Classes of com.cloudhopper.commons.util.URL

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.