?? getetctool.java
字號:
/**
*
*/
package com.corba.mnq.tool;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
public final class GetEtcTool {
private static EtcProperties props;
private static final String APPLICATION_DIRECTORY = "CorbaMNQ.dir";
private static final String PROPERTIES_FILE = "CorbaMNQ.properties";
/** used for java.util.logging */
private static final Logger LOG = Logger.getLogger(GetEtcTool.class
.getName());
/**
* Get the properties from servant.properties file. Don't cache the values,
* as they could change.
*
* @return an object of EtcProperties. Never <code>null</code>.
*/
public static synchronized EtcProperties getProperties() {
if (props != null) {
return props;
}
String dirName = System.getProperty(APPLICATION_DIRECTORY);
if (dirName == null || dirName.length() <= 0) {
LOG.severe("No value for System property '" + APPLICATION_DIRECTORY
+ "', using current directory instead");
dirName = ".";
} else if (LOG.isLoggable(Level.CONFIG))
LOG.config("System property '" + APPLICATION_DIRECTORY + "' is '"
+ dirName + "'");
String fPath = dirName + File.separator + "etc" + File.separator
+ PROPERTIES_FILE;
props = new EtcProperties(fPath);
return props;
}
private GetEtcTool() {
// Just to disallow creation of this object
}
/**
* Returns the logger object for use by
* {@link com.siemens.icm.nm.fw.logging.FFLoggable FFLoggable}.
*
* @return the logger to use
*/
public Logger getLogger() {
return LOG;
}
}
/* EOF */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -