Package com.alibaba.antx.config

Examples of com.alibaba.antx.config.ConfigException


        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

        ExtendedProperties props = new ExtendedProperties();

        try {
            props.load(istream, propsCharset, url);
        } catch (IOException e) {
            throw new ConfigException(e);
        } finally {
            if (istream != null) {
                try {
                    istream.close();
                } catch (IOException e) {
View Full Code Here

        if (propsFile.exists()) {
            try {
                props.load(propsFile.toURI().toURL(), propsCharset);
            } catch (IOException e) {
                throw new ConfigException(e);
            }
        }

        return props;
    }
View Full Code Here

        assertFile();

        try {
            return StreamUtil.readBytes(getInputStream(), true).toByteArray();
        } catch (IOException e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        assertFile();

        try {
            return channel.get(getURI().getPath());
        } catch (SftpException e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        assertFile();

        try {
            return channel.put(getURI().getPath());
        } catch (SftpException e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        List entries;

        try {
            entries = channel.ls(getURI().getPath());
        } catch (SftpException e) {
            throw new ConfigException(e);
        }

        List result = new ArrayList(entries.size());

        for (Iterator i = entries.iterator(); i.hasNext(); ) {
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

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.