1 package org.columba.core.config; 2 3 import java.io.File ; 4 5 import org.columba.core.base.OSInfo; 6 7 12 public class DefaultConfigDirectory { 13 14 private static DefaultConfigDirectory instance = new DefaultConfigDirectory(); 15 16 private File currentPath; 17 18 private DefaultConfigDirectory() {} 19 20 public static DefaultConfigDirectory getInstance() { 21 return instance; 22 } 23 24 30 public void setCurrentPath(File currentPath) { 31 this.currentPath = currentPath; 32 } 33 34 public File getCurrentPath() { 35 if ( currentPath == null) { 36 currentPath = DefaultConfigDirectory.getDefaultPath(); 38 } 39 40 return currentPath; 41 } 42 43 47 public static File getDefaultPath() { 48 if (OSInfo.isWindowsPlatform()) { 49 return new File ("config"); } 51 return new File (System.getProperty("user.home"), ".columba"); } 53 } 54 | Popular Tags |