1 // re/mind - Remote Reminder Software
2 // Copyright (C) 2002 Moritz Petersen
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 //
18 // $Id: UserPreferences.java,v 1.1.1.1 2002/09/29 17:26:04 powerpete Exp $
19 package de.jface.remind.io;
20
21 import de.jface.remind.Config;
22
23 import org.apache.log4j.Logger;
24
25 /***
26 * Class <code>UserPreferences</code>
27 * of project RemotePostIt.
28 *
29 * @author Moritz Petersen
30 * @version $Revision: 1.1.1.1 $
31 */
32 public abstract class UserPreferences
33 {
34 private static final Logger log4j = Logger.getLogger(UserPreferences.class);
35
36 public abstract String getUser();
37
38 public abstract String getHost();
39
40 public abstract String getPassword();
41
42 public static String getPreferencesPath()
43 {
44 return System.getProperty("user.home")
45 + System.getProperty("file.separator")
46 + Config.PREFERENCES_FILE_NAME;
47 }
48
49 public static String[] getAlternativePreferencesPaths()
50 {
51 return new String[0];
52 }
53
54 public static UserPreferences getInstance()
55 {
56 try
57 {
58 return (UserPreferences) Class.forName(
59 Config.USER_PREFERENCES_CLASS)
60 .newInstance();
61 }
62 catch (Exception e)
63 {
64 log4j.fatal("Unable to create instance", e);
65
66 // TODO: Throw an exception?
67 return null;
68 }
69 }
70 }
71
72 // ------1---------2---------3---------4---------5---------6---------7---------8
This page was automatically generated by Maven