Package java.util

Examples of java.util.Properties.load()


    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("ShapeSpecialist did not find properties file: \""
                    + file + "\"");
            System.exit(1);
        } catch (java.io.IOException e) {
View Full Code Here


//          final Properties defaultEncodings = getDefaultEncodings();
          final Properties encDef = new Properties();
          final BufferedInputStream bin = new BufferedInputStream(in);
          try
          {
            encDef.load(bin);
          }
          finally
          {
            bin.close();
          }
View Full Code Here

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

    }

    protected Properties loadProperties() {
        Properties props = new Properties();
        try {
            props.load(new FileInputStream(propsFileName));
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
        return props;
View Full Code Here

        filename = DataCrow.dataDir + filename;
       
        if (new File(filename).exists()) {
            try {
                FileInputStream fis = new FileInputStream(filename);
                properties.load(fis);
                fis.close();
               
                for (Object o : properties.keySet()) {
                    String key = (String) o;
                    DcField field = getField(key);
View Full Code Here

      try
      {
        final InputStream in = new BufferedInputStream(new FileInputStream(selFileName));
        try
        {
          prop.load(in);
        }
        finally
        {
          in.close();
        }
View Full Code Here

    }
   
    private static void initLog4j() {
        try {
            Properties properties = new Properties();
            properties.load(new FileInputStream(DataCrow.installationDir + "log4j.properties"));
            properties.setProperty("log4j.appender.logfile.File", DataCrow.dataDir + "data_crow.log");
           
            if (DataCrow.debug)
                properties.setProperty("log4j.rootLogger", "debug, textpane, logfile, stdout");
            else
View Full Code Here

    private static void initDbProperties() {
        try {
            File file = new File(DataCrow.dataDir, DcSettings.getString(DcRepository.Settings.stConnectionString) + ".properties");
            if (file.exists()) {
                Properties properties = new Properties();
                properties.load(new FileInputStream(file));
               
                properties.setProperty("hsqldb.script_format", "3");
                properties.setProperty("readonly", "false");
                properties.setProperty("hsqldb.nio_data_file", "true");
                properties.setProperty("hsqldb.default_table_type", "memory");
View Full Code Here

                InputStream in = VPFLayer.class.getResourceAsStream("defaultVPFlayers.properties");
                //use a temporary so other threads won't see an
                //empty properties file
                Properties tmp = new Properties();
                if (in != null) {
                    tmp.load(in);
                    in.close();
                } else {
                    Debug.error("VPFLayer: can't load default properties file");
                    //just use an empty properties file
                }
View Full Code Here

        Properties props = new Properties();
        try {
          final InputStream asStream = XMLBaseTest.class.getResourceAsStream("/testsettings.properties");
          try
          {
            props.load(asStream);//$NON-NLS-1$
            reportDefinitionPath = props.getProperty("REPORT_DEFINITION_PATH"); //$NON-NLS-1$
            reportInputPath = props.getProperty("REPORT_INPUT_PATH"); //$NON-NLS-1$
            reportOutputPath = props.getProperty("REPORT_OUTPUT_PATH"); //$NON-NLS-1$
          }
          finally
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.