Package com.alibaba.antx.config

Examples of com.alibaba.antx.config.ConfigException


                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() : null;

        try {
            this.uri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
                    newQueryStr, uri.getFragment());
        } catch (URISyntaxException e) {
            throw new ConfigException(e);
        }

        this.options = options;
    }
View Full Code Here


    private static URI fixFileURI(URI uri) {
        if ("file".equals(uri.getScheme())) {
            try {
                uri = URI.create(util.substitute("s/file:\\/*/file:\\//", uri.toString()));
            } catch (Exception e) {
                throw new ConfigException(e);
            }
        }

        return uri;
    }
View Full Code Here

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

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

        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

        Scanner scanner = new DirectoryScanner(getConfigEntryResource().getFile(), handler);

        try {
            scanner.scan();
        } catch (ScannerException e) {
            throw new ConfigException(e);
        }

        subEntries = handler.getSubEntries();

        getGenerator().init();
View Full Code Here

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

                istream = new BufferedInputStream(istream, 8192);
            }

            return addConfigDescriptor(descriptorResource, istream);
        } catch (IOException e) {
            throw new ConfigException(e);
        } finally {
            if (istream != null) {
                try {
                    istream.close();
                } catch (IOException e) {
View Full Code Here

    @Override
    public byte[] getContent() {
        try {
            return StreamUtil.readBytes(getInputStream(), true).toByteArray();
        } catch (IOException e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        digester.push(new ConfigDescriptor(descriptorResource));

        try {
            return (ConfigDescriptor) digester.parse(istream);
        } catch (Exception e) {
            throw new ConfigException("Failed to load config descriptor: " + descriptorResource.getURL(), e);
        }
    }
View Full Code Here

        InputStream istream = getClass().getResourceAsStream("validators.xml");

        try {
            digester.push(digester.parse(istream));
        } catch (Exception e) {
            throw new ConfigException("Failed to load validators", e);
        } finally {
            if (istream != null) {
                try {
                    istream.close();
                } catch (IOException e) {
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.