1 32 33 package scioworks.imap.spec; 34 35 import com.lutris.util.Config; 36 import com.lutris.util.ConfigException; 37 import com.lutris.appserver.server.Enhydra; 38 39 public class ImapWebConstant { 40 41 private static ImapWebConstant fSingleton; 42 43 private String fDomain; 44 private String fSmtpHost; 45 private String fImapHost; 46 private int fImapPort; 47 48 private String fFolderSent; 49 private String fFolderTrash; 50 51 private String fFileTmpDir; 52 private int fFileCount; 53 private int fFileTotalSize; 54 55 private ImapWebConstant() { 56 57 Config config = Enhydra.getApplication().getConfig(); 58 59 try { 60 fDomain = config.getString("ImapWeb.Server.Domain"); 61 fSmtpHost = config.getString("ImapWeb.Server.SmtpHost"); 62 fImapHost = config.getString("ImapWeb.Server.ImapHost"); 63 fImapPort = config.getInt ("ImapWeb.Server.ImapPort"); 64 65 fFolderSent = config.getString("ImapWeb.Folder.FolderSent"); 66 fFolderTrash = config.getString("ImapWeb.Folder.FolderTrash"); 67 68 fFileTmpDir = config.getString("ImapWeb.Attachment.FileTmpDir"); 69 fFileCount = config.getInt ("ImapWeb.Attachment.FileCount"); 70 fFileTotalSize = config.getInt("ImapWeb.Attachment.FileTotalSize"); 71 72 } catch (ConfigException e) { 73 e.printStackTrace(); 74 } 75 76 90 } 91 92 public static synchronized ImapWebConstant singleton() { 93 if (fSingleton == null) { 94 fSingleton = new ImapWebConstant(); 95 } 96 return fSingleton; 97 } 98 99 101 public String domain() { 102 return fDomain; 103 } 104 105 public String smtpHost() { 106 return fSmtpHost; 107 } 108 109 public String imapHost() { 110 return fImapHost ; 111 } 112 113 public int imapPort() { 114 return fImapPort; 115 } 116 117 public String folderSent() { 118 return fFolderSent; 119 } 120 121 public String folderTrash() { 122 return fFolderTrash; 123 } 124 125 public String fileTmpDir() { 126 return fFileTmpDir; 127 } 128 129 public int fileCount() { 130 return fFileCount; 131 } 132 133 public int fileTotalSize() { 134 return fFileTotalSize; 135 } 136 } 137 138 | Popular Tags |