Package java.util

Examples of java.util.Properties.load()


    public Properties findAndLoadProperties(String propertiesResource) {
        try {
            URL url = PropUtils.getResourceOrFileOrURL(SymbolReferenceLibrary.class,
                    propertiesResource);
            Properties props = new Properties();
            props.load(url.openStream());
            return props;
        } catch (java.net.MalformedURLException murle) {
            Debug.output("SymbolReferenceLibrary has malformed path to "
                    + propertiesResource);
        } catch (java.io.IOException ioe) {
View Full Code Here


            is = url.openStream();
        }

        Properties tmpProperties = new Properties();
        if (is != null) {
            tmpProperties.load(is);
        }

        init(tmpProperties, "URL");
        Environment.init(getProperties());
    }
View Full Code Here

                    if (tmpInclude == null) {
                        continue;
                    }

                    InputStream is = tmpInclude.openStream();
                    tmpProps.load(is);
                    if (DEBUG) {
                        Debug.output("PropertyHandler.getIncludeProperties(): located include properties file URL: "
                                + include);
                    }
                    // Include properties noted in resources
View Full Code Here

        }
        Properties p = new Properties();
        if (propsURL != null) {
            try {
                InputStream is = propsURL.openStream();
                p.load(is);
                is.close();
            } catch (IOException e) {
                Debug.error("PropertyHandler.getProperties(): "
                        + "Exception reading map properties at " + propsURL
                        + ": " + e);
View Full Code Here

    public Properties loadProps(String file) {
        java.io.File propsFile = new java.io.File(file);
        Properties props = new Properties();
        try {
            java.io.InputStream propsStream = new java.io.FileInputStream(propsFile);
            props.load(propsStream);
        } catch (java.io.FileNotFoundException e) {
            System.err.println("CorbaImageServer did not find properties file: \""
                    + file + "\"");
            System.exit(1);
        } catch (java.io.IOException e) {
View Full Code Here

                        in = new FileInputStream(configFile);
                    }
                    if (in == null) {
                        properties = new Properties();
                    } else {
                        properties.load(in);
                        in.close();
                    }
                    //convert the properties to legal values, use default if no props available.
                    boolean distribute = Boolean.valueOf(properties.getProperty("distribute", "false")).booleanValue();
                    String logFileName = properties.getProperty("logFileName", "jcache.log");
View Full Code Here

    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        Audio doc = (Audio) getValue();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            if (doc == null) doc = new Audio();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
View Full Code Here

    @SuppressWarnings("unchecked")
    public Image getImage(String text) throws IllegalArgumentException {
        Image doc = new Image();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            if (doc == null) doc = new Image();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
View Full Code Here

    @SuppressWarnings("unchecked")
    public Document getDocument(String text) throws IllegalArgumentException {
        Document doc = new Document();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
            doc.setIdentifier(properties.getProperty("identifier"));
View Full Code Here

    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        Video doc = (Video) getValue();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            String uri = properties.getProperty("uri");
            Assert.isEncrypted(decipherer, uri);
            if (doc == null) doc = new Video();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.