private void readConfigurations() { ConfigurationManager manager = ConfigurationManager.getInstance(); Configuration gtasConfig = manager.getConfig(IGtasConfig.CONFIG_NAME); sm.setAttribute(IAttributeKeys.ENTERPRISE_ID, gtasConfig.getString(IGtasConfig.ENTERPRISE_ID)); sm.setAttribute(IAttributeKeys.APPLICATION, gtasConfig.getString(IGtasConfig.APPLICATION_NAME)); // sm.setAttribute(IAttributeKeys.APPLICATION, "gridtalk"); }
/** * Returns the path after removing the domain from the front. * * @param fullPath The full path with the domain * @return The path without the domain * @author Daniel D'Cotta */ public String getPathWithoutDomain(String fullPath) throws FileAccessException { if (fullPath == null) throw new FileAccessException("fullpath is null"); String domainPath = null; if (_isLocal) { try { domainPath = _rootFile.getCanonicalPath(); } catch (IOException ex) { throw new FileAccessException("could not get local root path", ex); } } else { Configuration config = ConfigurationManager.getInstance().getConfig(IFrameworkConfig.FRAMEWORK_WEBDAV_CONFIG); // ConfigManager configManager = ConfigManager.getInstance("file" + // File.separatorChar + // "webdav.properties"); HttpURL httpURL = new HttpURL(config.getString(IFrameworkConfig.WEBDAV_SERVER + _domain)); // HttpURL httpURL = new HttpURL(configManager.get("webdav.server." + _domain)); domainPath = httpURL.getPath(); } if (fullPath.startsWith(domainPath)) { String path = fullPath.substring(domainPath.length()); // Remove leading file seperator while (path.charAt(0) == '/' || path.charAt(0) == '\\') path = path.substring(1); return path; } else { throw new FileAccessException("fullPath does not start with domainPath"); } }
public static String getTempFolderPath() { try { ConfigurationManager configManager = ConfigurationManager.getInstance(); Configuration config = configManager.getConfig(ITempDirConfig.TEMP_DIR_CONFIG); java.io.File file = new java.io.File(config.getString(ITempDirConfig.TEMP_DIR)); if (!file.exists()) { file.mkdir(); } return file.getCanonicalPath(); } catch (Exception ex) { return null; } }