Package java.util

Examples of java.util.Properties.loadFromXML()


   if (!df.exists()) return false;

   try {
      Properties p = new Properties();
      FileInputStream fis = new FileInputStream(df);
      p.loadFromXML(fis);
      for (Object opn : p.keySet()) {
   String pn = (String) opn;
   String pv = p.getProperty(pn);
   System.setProperty(pn,pv);
       }
View Full Code Here


                OwnSyncException ose = new OwnSyncException("Config file does not exist, is created and initialized!");
                logger.throwing("OwnSyncStarter", "loadConfig(" + config + ")", ose);
                throw ose;
            }
            props = new Properties();
            props.loadFromXML(new FileInputStream(configFile));

            createLogger(props);
           
            folderAConfiguration = new FolderConfiguration(SyncFolderA, SyncFolderStateA, WastbasketFolderA, KeepLastFileVersionA, SyncExclusionPatternsA, props);
           
View Full Code Here

        Properties folderStateProperties = new Properties();
        HashMap folderState = null;
        try
        {
            folderStateProperties.loadFromXML(new BufferedInputStream(new FileInputStream(readFromFile)));

            String key;
            ArrayList list = new ArrayList(folderStateProperties.keySet());
           
            folderState = new HashMap(list.size());
View Full Code Here

        Properties folderStateProperties = new Properties();
        HashMap folderState = null;
        try
        {
            folderStateProperties.loadFromXML(new BufferedInputStream(new FileInputStream(readFromFile)));

            String key;
            ArrayList list = new ArrayList(folderStateProperties.keySet());
           
            folderState = new HashMap(list.size());
View Full Code Here

    public static <T> void loadClasses(String path,
        Map<String, Class<? extends T>> whereToPutProperties) {
      Logger logger = Logger.getLogger(JSBML.class);
      Properties p = new Properties();
      try {
        p.loadFromXML(Resource.getInstance().getStreamFromResourceLocation(
            path));
        for (Map.Entry<Object, Object> entry : p.entrySet()) {
          try {
            whereToPutProperties.put(entry.getKey().toString(),
                (Class<T>) Class.forName(entry.getValue().toString()));
View Full Code Here

    public static <T> void loadClasses(String path,
        Map<String, Class<? extends T>> whereToPutProperties) {
      Logger logger = Logger.getLogger(JSBML.class);
      Properties p = new Properties();
      try {
        p.loadFromXML(Resource.getInstance().getStreamFromResourceLocation(
            path));
        for (Map.Entry<Object, Object> entry : p.entrySet()) {
          try {
            whereToPutProperties.put(entry.getKey().toString(),
                (Class<T>) Class.forName(entry.getValue().toString()));
View Full Code Here

     * @throws ClassNotFoundException
     */
    private void initializeCoreElements() throws IOException,
  ClassNotFoundException {
  Properties p = new Properties();
  p.loadFromXML(Resource.getInstance().getStreamFromResourceLocation(
      "org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml"));
  for (Object k : p.keySet()) {
      String key = k.toString();
      SBMLCoreElements.put(key, Class.forName(p.getProperty(key)
        .toString()));
View Full Code Here

     * @throws ClassNotFoundException
     */
    private void initializeCoreElements() throws IOException,
  ClassNotFoundException {
  Properties p = new Properties();
  p.loadFromXML(Resource.getInstance().getStreamFromResourceLocation(
      "org/sbml/jsbml/resources/cfg/SBMLElementsLevel1Version1.xml"));
  for (Object k : p.keySet()) {
      String key = k.toString();
      SBMLCoreElements.put(key, Class.forName(p.getProperty(key)
        .toString()));
View Full Code Here

    final String locale = filename.substring(0, end);

    final Properties temp = new Properties();
    try {
      if (xml) {
        temp.loadFromXML(stream);
        if (LOG.isDebugEnabled()) {
          LOG.debug(childPath);
          LOG.debug("xml properties: {}", temp.size());
        }
      } else {
View Full Code Here

  public Properties loadProperties(String file) {
    try {
      Properties p = new Properties();
      InputStream in = FileHelper.getInputStream(file);
      if(file.endsWith(".xml")) {
        p.loadFromXML(in);
      }else {
        p.load(in);
      }
      in.close();
      return p;
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.