Get Global Properties
private Properties properties;
/**
*
* @method setProperties
* @param properties
*/
public void setProperty(Properties properties)
{
logger.debug("setting properties");
this.properties = properties;
}
public String getGlobalProp(String propName)
{
logger.debug("getting properties");
return this.properties.getProperty(propName);
}
/**
*
* @method setProperties
* @param properties
*/
public void setProperty(Properties properties)
{
logger.debug("setting properties");
this.properties = properties;
}
public String getGlobalProp(String propName)
{
logger.debug("getting properties");
return this.properties.getProperty(propName);
}
======================
Properties properties;
public Map<String, Object> executeImpl(WebScriptRequest request, Status status)
{
String alf_dir = properties.getProperty("dir.root");
}
public Properties getProperties() {
return properties;
}
public void setProperties(Properties properties) {
this.properties = properties;
}
========================================
import java.util.ResourceBundle;
public final class CommonConstants {
private CommonConstants()
{
// private constructor
}
private static final ResourceBundle COMMON_BUNDLE = ResourceBundle.getBundle("alfresco.messages.common-messages");
public static final String EXCLUDE_FOLDERS = COMMON_BUNDLE.getString("EXCLUDE_FOLDERS");
public static final String EXCLUDE_PROPERTIES = COMMON_BUNDLE.getString("EXCLUDE_PROPERTIES");
}
public class NodeUtility {
private static final String IGNORE_FOLDERS_LIST = CommonConstants.EXCLUDE_FOLDERS;
private static final String IGNORE_PROPERTIES_LIST = CommonConstants.EXCLUDE_PROPERTIES;
}
======================================
Comments
Post a Comment