Package org.jboss.forge.addon.configuration

Examples of org.jboss.forge.addon.configuration.Configuration


   public void listConfiguration(UIContext context, UIOutput output)
   {
      PrintStream out = output.out();

      Project project = Projects.getSelectedProject(projectFactory, context);
      Configuration projectConfig = null;

      if (project != null)
      {
         projectConfig = project.getFacet(ConfigurationFacet.class).getConfiguration();
      }

      Iterator<?> userConfigKeys = userConfig.getKeys();

      while (userConfigKeys.hasNext())
      {
         Object key = userConfigKeys.next();

         if (key != null)
         {
            out.print(key.toString());
            out.print("=");

            out.print("user: [" + userConfig.getProperty(key.toString()) + "]");
            if (projectConfig != null)
            {
               out.print(", project: ");
               Object value = projectConfig.getProperty(key.toString());
               if (value != null)
               {
                  out.print("[" + value.toString() + "] ");
               }
               else
                  out.print("[]");
            }
         }
         out.println();
      }

      if (projectConfig != null)
      {
         Iterator<?> projectConfigKeys = projectConfig.getKeys();

         while (projectConfigKeys.hasNext())
         {
            String key = projectConfigKeys.next().toString();
            if (!userConfig.containsKey(key))
            {
               out.print(key.toString());
               out.print("=project: [");
               out.print(projectConfig.getProperty(key.toString()).toString() + "]");
            }
            out.println();
         }
      }
   }
View Full Code Here


      return REPOSITORY;
   }

   public String remoteRepository()
   {
      Configuration user = userConfig();
      if (user.containsKey(REPOSITORY_KEY))
      {
         return user.getString(REPOSITORY_KEY);
      }
      return defaultRemoteRepository();
   }
View Full Code Here

      return new File(System.getProperty("user.home") + File.separator + ".gitignore_boilerplate");
   }
  
   public File localRepository()
   {
      Configuration user = userConfig();
      if (user.containsKey(CLONE_LOCATION_KEY))
      {
         return new File(user.getString(CLONE_LOCATION_KEY));
      }
      return defaultLocalRepository();
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.configuration.Configuration

Copyright © 2018 www.massapicom. 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.