Author: ruschein
Date: 2011-06-21 13:13:56 -0700 (Tue, 21 Jun 2011)
New Revision: 25837

Modified:
   
core3/swing-application-impl/trunk/src/main/java/org/cytoscape/internal/CyOperatingContextImpl.java
Log:
Replaced private copy of CONFIG_DIR.

Modified: 
core3/swing-application-impl/trunk/src/main/java/org/cytoscape/internal/CyOperatingContextImpl.java
===================================================================
--- 
core3/swing-application-impl/trunk/src/main/java/org/cytoscape/internal/CyOperatingContextImpl.java
 2011-06-21 19:48:28 UTC (rev 25836)
+++ 
core3/swing-application-impl/trunk/src/main/java/org/cytoscape/internal/CyOperatingContextImpl.java
 2011-06-21 20:13:56 UTC (rev 25837)
@@ -1,16 +1,8 @@
-
 /*
  File: CyOpertatingContextImpl.java
 
- Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2011, The Cytoscape Consortium (www.cytoscape.org)
 
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as published
  by the Free Software Foundation; either version 2.1 of the License, or
@@ -34,10 +26,10 @@
  You should have received a copy of the GNU Lesser General Public License
  along with this library; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
+*/
 package org.cytoscape.internal;
 
+
 import java.util.Properties;
 import java.io.File;
 import java.io.FileInputStream;
@@ -48,6 +40,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Basic access to Cytoscape's operating context. 
  */
@@ -55,8 +48,6 @@
 // dialog - this needs to be supported more generally on an application level, 
perhaps
 // on a shutdown event?
 public class CyOperatingContextImpl {
-
-       public static final String CONFIG_DIR = ".cytoscape";
        public static final String PROPS = "cytoscape.props";
 
        private static final Logger logger = 
LoggerFactory.getLogger(CyOperatingContextImpl.class);
@@ -74,12 +65,12 @@
 
        private void loadLocalProps() {
                try {
-            File vmp = getConfigFile(PROPS);
+                       File vmp = getConfigFile(PROPS);
 
-            if (vmp != null)
-                props.getProperties().load(new FileInputStream(vmp));
-            else
-                logger.warn("couldn't read " + PROPS + " from " + CONFIG_DIR);
+                       if (vmp != null)
+                               props.getProperties().load(new 
FileInputStream(vmp));
+                       else
+                               logger.warn("couldn't read " + PROPS + " from " 
+ CyProperty.DEFAULT_CONFIG_DIR);
                } catch (IOException ioe) {
                        ioe.printStackTrace();
                }
@@ -98,19 +89,19 @@
         * Returns a {@link File} pointing to the config directory.
         */
        public File getConfigDirectory() {
-        try {
-            String dirName = 
props.getProperties().getProperty("alternative.config.dir", 
System.getProperty("user.home"));
-            File parent_dir = new File(dirName, CONFIG_DIR);
+               try {
+                       String dirName = 
props.getProperties().getProperty("alternative.config.dir", 
System.getProperty("user.home"));
+                       File parent_dir = new File(dirName, 
CyProperty.DEFAULT_CONFIG_DIR);
 
-            if (parent_dir.mkdir())
-                logger.warn("Parent_Dir: " + parent_dir + " created.");
+                       if (parent_dir.mkdir())
+                               logger.warn("Parent_Dir: " + parent_dir + " 
created.");
 
-            return parent_dir;
-        } catch (Exception e) {
-            logger.warn("error getting config directory");
-        }
+                       return parent_dir;
+               } catch (Exception e) {
+                       logger.warn("error getting config directory");
+               }
 
-        return null;
+               return null;
        }
 
        /**

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to