Package com.alibaba.antx.config

Examples of com.alibaba.antx.config.ConfigException


        try {
            superuri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), superpath,
                               uri.getQuery(), uri.getFragment()).normalize();
        } catch (URISyntaxException e) {
            throw new ConfigException(e);
        }

        return new ResourceURI(superuri, options);
    }
View Full Code Here


        // ִ�г�ʼ��.
        try {
            engine.init();
        } catch (Exception e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

                username = StringUtil.trimWhitespace(resourceManager.getIn().readLine());
            }

            password = new PasswordField().getPassword(resourceManager.getOut(), "Enter Password: ", message);
        } catch (IOException e) {
            throw new ConfigException(e);
        }

        savePassword(uri, username, password);

        return new UsernamePassword(username, password);
View Full Code Here

        String userPass;

        try {
            userPass = new String(Base64.decodeBase64(encodedPassword.getBytes("8859_1")), "8859_1");
        } catch (Exception e) {
            throw new ConfigException(e);
        }

        int index = userPass.indexOf(":");
        String user = null;
        String pass = null;
View Full Code Here

            passwords.put(key, encodedPassword);

            boolean succ = savePasswordFile(passwords);

            if (!succ) {
                throw new ConfigException("Cannot save file: " + passwordFile.getAbsolutePath());
            }
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        return -1;
    }

    protected void assertFile() {
        if (isDirectory()) {
            throw new ConfigException("Resource is not a file: " + getURI());
        }
    }
View Full Code Here

        }
    }

    protected void assertDirectory() {
        if (!isDirectory()) {
            throw new ConfigException("Resource is not a directory: " + getURI());
        }
    }
View Full Code Here

            Header contentTypeHeader = httpget.getResponseHeader("Content-Type");
            contentType = contentTypeHeader == null ? null : contentTypeHeader.getValue();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new ConfigException(e);
        } finally {
            ResourceContext.get().setCurrentURI(null);

            if (stream != null) {
                try {
View Full Code Here

    private Session getSession(String type) {
        ResourceDriver driver = (ResourceDriver) drivers.get(type);

        if (driver == null) {
            throw new ConfigException("No drivers for resource type: " + type);
        }

        Session session;

        synchronized (sessions) {
View Full Code Here

                try {
                    key = StringUtil.trimWhitespace(URLDecoder.decode(key, "UTF-8"));
                    value = StringUtil.trimWhitespace(URLDecoder.decode(value, "UTF-8"));
                } catch (UnsupportedEncodingException e) {
                    throw new ConfigException(e);
                }

                if (!StringUtil.isEmpty(key) && session != null && session.acceptOption(key)) {
                    options.put(key, value);
                } else {
                    if (newQuery.length() > 0) {
                        newQuery.append("&");
                    }

                    newQuery.append(token);
                }
            }
        }

        String newQueryStr = newQuery.length() > 0 ? newQuery.toString() : "";

        try {
            this.uri = new URI(replace(uri.toString(), query, newQueryStr));
        } catch (URISyntaxException e) {
            throw new ConfigException(e);
        }

        this.options = options;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.antx.config.ConfigException

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.