View Javadoc

1   package net.sourceforge.simplegamenet.framework.model;
2   
3   import java.io.File;
4   import net.sourceforge.simplegamenet.specs.to.Version;
5   
6   public class SimpleGameNetSettings {
7   
8       private static final Version VERSION = new Version(1, 0, 2);
9       private static final String[] AUTHORS = {
10          "Frederik Cocquyt", "Geoffrey De Smet", "Laurent Debacker"
11      };
12      private static final String SITE = "http://simplegamenet.sf.net";
13      private static final String APP_SETTINGS_DIR_SUFFIX = ".SimpleGameNet";
14  
15      private static SimpleGameNetSettings instance;
16  
17      public static synchronized SimpleGameNetSettings getInstance() {
18          if (instance == null) {
19              instance = new SimpleGameNetSettings();
20          }
21          return instance;
22      }
23  
24      private File appSettingsDir;
25  
26      private SimpleGameNetSettings() {
27          appSettingsDir = new File(System.getProperty("user.home") + File.separator
28                  + APP_SETTINGS_DIR_SUFFIX);
29          if (!appSettingsDir.isDirectory()) {
30              boolean appSettingsDirAvailable = appSettingsDir.mkdirs();
31              if (!appSettingsDirAvailable) {
32                  appSettingsDir = null;
33              }
34          }
35      }
36  
37      public Version getVersion() {
38          return VERSION;
39      }
40  
41      public String[] getAuthors() {
42          return AUTHORS;
43      }
44  
45      public String getSite() {
46          return SITE;
47      }
48  
49      public File getAppSettingsDir() {
50          return appSettingsDir;
51      }
52  }