Package java.util

Examples of java.util.Properties.load()


    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        I18nText i18n = (I18nText) getValue();
        Properties properties = new Properties();
        try {
            properties.load(IOUtils.toInputStream(text));
            if (i18n == null) {
                i18n = new I18nText();
                i18n.initialize(context);
            }
            i18n.setKey(properties.getProperty("key"));
View Full Code Here


    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        Image doc = (Image) 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 Image();
            doc.setUri(decipherer.decrypt(uri));
            doc.setMimeType(properties.getProperty("mimeType"));
View Full Code Here

    @SuppressWarnings("unchecked")
    public Audio getAudio(String text) throws IllegalArgumentException {
        Audio doc = new Audio();
        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

      final File target = new File(baseDirectory, configPath);
      final InputStream in = new BufferedInputStream(new FileInputStream(
          target));
      try
      {
        properties.load(in);
      }
      finally
      {
        in.close();
      }
View Full Code Here

           
            FileInputStream fos = null;
            try {
                fos = new FileInputStream(filename);
                Properties properties = new Properties();
                properties.load(fos);
                for (Object value : properties.values())
                    conversions.add(new Conversion((String) value));
               
            } catch (IOException e) {
                logger.error("Failed to load database column conversion scripts", e);
View Full Code Here

       
        DcLanguageResource english = new DcLanguageResource("English");
        for (String propertyFile : propertyFiles) {
            Properties p = new Properties();
            try {
                p.load(getClass().getResourceAsStream(propertyFile));
            } catch (Exception ignore) {
                try {
                    p.load(getClass().getResourceAsStream("/net/sf/dc/core/resources/" + propertyFile));
                } catch (Exception e) {
                    logger.error("Could not load sustom resource files. Falling back to the default resources.", e);
View Full Code Here

            Properties p = new Properties();
            try {
                p.load(getClass().getResourceAsStream(propertyFile));
            } catch (Exception ignore) {
                try {
                    p.load(getClass().getResourceAsStream("/net/sf/dc/core/resources/" + propertyFile));
                } catch (Exception e) {
                    logger.error("Could not load sustom resource files. Falling back to the default resources.", e);
                    DcSwingUtilities.displayErrorMessage("Unable to load custom resources! " + e.toString());
                }
            }
View Full Code Here

        try {
            File file = settings.getSettingsFile();
           
            if (file.exists()) {
                FileInputStream fis = new FileInputStream(file);
                properties.load(fis);
                fis.close();
            } else {
                return;
            }
        } catch (Exception ignore) {
View Full Code Here

     */
    public void init(String prefix, java.net.URL url) {
        try {
            java.io.InputStream in = url.openStream();
            Properties props = new Properties();
            props.load(in);
            init(getLayers(prefix, props));
        } catch (java.net.MalformedURLException murle) {
            Debug.error("LayerHandler.init(URL): " + url
                    + " is not a valid URL");
        } catch (java.io.IOException e) {
View Full Code Here

        if (propsIn == null) {
            System.err.println("Unable to locate resources: " + crewResources);
            System.err.println("Using default resources.");
        } else {
            try {
                crewProps.load(propsIn);
            } catch (java.io.IOException e) {
                System.err.println("Caught IOException loading resources: "
                        + crewResources);
                System.err.println("Using default resources.");
            }
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.