Package java.util

Examples of java.util.Properties.loadFromXML()


    public static Properties readProperties(byte b[]) {
        Properties prop = new Properties();
        try {
            if (b != null) {
                prop.loadFromXML(new ByteArrayInputStream(b));
            }
        } catch (IOException e) {
        }
        return prop;
    }
View Full Code Here


      // load properties
      Properties props = new Properties();
      InputStream is = ConceptDaoImpl.class.getClassLoader()
          .getResourceAsStream(propRes);
      try {
        props.loadFromXML(is);
      } finally {
        is.close();
      }
      // determine directory for concept graph - attempt to put in same
      // dir as props
View Full Code Here

                if (log.isDebugEnabled()) {
                    log.debug("Loading properties from path [" + resourcePath + "] in XML format...");
                }

                props.loadFromXML(is);
            } else {

                if (log.isDebugEnabled()) {
                    log.debug("Loading properties from path [" + resourcePath + "]...");
                }
View Full Code Here

    if (metaFolder.isDirectory()){
      for(File meta: metaFolder.listFiles()){
        try {
          Properties prop = new Properties();
          FileInputStream in = new FileInputStream(meta);
          prop.loadFromXML(in);
          File tmp = new File(prop.getProperty("file"));
          if (tmp.exists()){
            String downloadFrom = prop.getProperty("download-from");
            String uploadTo = prop.getProperty("upload-to");
            long modified = new Long(prop.getProperty("modified")).longValue();
View Full Code Here

  @Provides @Singleton
  LdapContext provideLdapContext() {
    try {
      Properties properties =  new Properties();
      InputStream xmlStream = getClass().getResourceAsStream("/META-INF/ldap.xml");   
      properties.loadFromXML(xmlStream);
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, properties.get(Context.INITIAL_CONTEXT_FACTORY));
      env.put(Context.SECURITY_PRINCIPAL,      properties.get(Context.SECURITY_PRINCIPAL));
      env.put(Context.PROVIDER_URL,            properties.get(Context.PROVIDER_URL));
      env.put(Context.SECURITY_CREDENTIALS,    properties.get(Context.SECURITY_CREDENTIALS));
View Full Code Here

     */
    private long loadVersion(File propertiesfile) {
        long result = CachedRepositoryImpl.UNCOMMITTED_VERSION;
        try {
            Properties props = new Properties();
            props.loadFromXML(new FileInputStream(propertiesfile));
            result = Long.parseLong((String) props.get(VERSION));
        }
        catch (IOException ioe) {
            // We have no data; no problem.
        }
View Full Code Here

            switch (_type) {
                case PROPERTIES:
                    props.load(stream);
                    break;
                case XML:
                    props.loadFromXML(stream);
                    break;
                default:
                    throw CommonCoreMessages.MESSAGES.unsupportedPropertiesTypeForMethod(_type, "pull(InputStream)");
            }
        }
View Full Code Here

                       
            if (r3sponse.getStatus() == HttpStatus.OK_200)
            {
                response = new Properties();
                resStream = new ByteArrayInputStream(r3sponse.getContent());
                response.loadFromXML(resStream);              
            }
        }
        finally
        {
            try
View Full Code Here

   Properties p = new Properties();

   if (dbf.exists()) {
      try {
   FileInputStream fis = new FileInputStream(dbf);
   p.loadFromXML(fis);
   fis.close();
       }
      catch (IOException e) {
   System.err.println("IVY: Problem reading property file " + dbf + ": " + e);
       }
View Full Code Here

   Properties p = new Properties();

   if (pf.exists()) {
      try {
   FileInputStream fis = new FileInputStream(pf);
   p.loadFromXML(fis);
   fis.close();
       }
      catch (IOException e) {
   System.err.println("IVYSETUP: Problem loading old properties: " + e);
       }
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.