1
2
3
4
5
6
7 package com.wickle.Jdiary;
8
9 import java.util.prefs.Preferences;
10
11 /***
12 * @author vic
13 *
14 * TODO To change the template for this generated type comment go to
15 * Window - Preferences - Java - Code Style - Code Templates
16 */
17 public class Preferencias {
18
19 private String HOST;
20 private String USERNAME;
21 private String PASSWORD;
22 private String DIARIO;
23 private Preferences prefs;
24
25 public Preferencias(){
26 prefs = Preferences.userNodeForPackage(this.getClass());
27
28 }
29
30 /***
31 * @return Returns the dIARIO.
32 */
33 public String getDIARIO() {
34 return prefs.get("DIARIO","NULL");
35 }
36 /***
37 * @param diario The dIARIO to set.
38 */
39 public void setDIARIO(String diario) {
40 DIARIO = diario;
41 prefs.put("DIARIO",diario);
42 }
43 /***
44 * @return Returns the hOST.
45 */
46 public String getHOST() {
47 return prefs.get("HOST","NULL");
48 }
49 /***
50 * @param host The hOST to set.
51 */
52 public void setHOST(String host) {
53 HOST = host;
54 prefs.put("HOST",host);
55 }
56 /***
57 * @return Returns the pASSWORD.
58 */
59 public String getPASSWORD() {
60 return prefs.get("PASSWORD","NULL");
61 }
62 /***
63 * @param password The pASSWORD to set.
64 */
65 public void setPASSWORD(String password) {
66 PASSWORD = password;
67 prefs.put("PASSWORD",password);
68 }
69 /***
70 * @return Returns the uSERNAME.
71 */
72 public String getUSERNAME() {
73 return prefs.get("USERNAME","NULL");
74 }
75 /***
76 * @param username The uSERNAME to set.
77 */
78 public void setUSERNAME(String username) {
79 USERNAME = username;
80 prefs.put("USERNAME",username);
81 }
82 }