private File getTemplateFile(String templateFileName) { File templateDir = globalConfig.getProfileTemplateDir(); return new File(templateDir, templateFileName); }
/** * @param key the name * @return a DroidGlobalProperty */ public static DroidGlobalProperty forName(String key) { DroidGlobalProperty property = allValues.get(key); return property != null && property.isUserConfigurable() ? property : null; }
private String getReportDir() { String dir = ""; if (globalConfig != null) { File reportDir = globalConfig.getReportDefinitionDir(); dir = reportDir == null ? "" : reportDir.getAbsolutePath(); } return dir; }
/** * {@inheritDoc} */ @Override public void init(DroidGlobalConfig config) { setEndpointUrl(config.getProperties().getString(DroidGlobalProperty.BINARY_UPDATE_URL.getName())); }
/** * {@inheritDoc} */ @Override public void closeProfile(String profileName) { log.info("Closing profile: " + profileName); profileContextLocator.removeProfileContext(profileName); if (!config.getProperties().getBoolean(DroidGlobalProperty.DEV_MODE.getName())) { File profileHome = new File(config.getProfilesDir(), profileName); FileUtils.deleteQuietly(profileHome); } }
/** * Returns the value of the boolean property specified. * The runtime exception will be thrown if the specified property has no boolean representation. * @param propertyKey the property * @return the boolean value */ public boolean getBooleanProperty(DroidGlobalProperty propertyKey) { return props.getBoolean(propertyKey.getName()); }
private Path getProfileHomeDir(ProfileInstance profile) { return config.getProfilesDir().resolve(profile.getUuid()); }
/** * {@inheritDoc} */ @Override public void init(DroidGlobalConfig config) { setEndpointUrl(config.getProperties().getString(DroidGlobalProperty.BINARY_UPDATE_URL.getName())); }
/** * {@inheritDoc} */ @Override public void closeProfile(String profileName) { log.info("Closing profile: " + profileName); profileContextLocator.removeProfileContext(profileName); if (!config.getProperties().getBoolean(DroidGlobalProperty.DEV_MODE.getName())) { final Path profileHome = config.getProfilesDir().resolve(profileName); FileUtil.deleteQuietly(profileHome); } }
/** * Returns the value of the boolean property specified. * The runtime exception will be thrown if the specified property has no boolean representation. * @param propertyKey the property * @return the boolean value */ public boolean getBooleanProperty(DroidGlobalProperty propertyKey) { return props.getBoolean(propertyKey.getName()); }
private String getReportDir() { String dir = ""; if (globalConfig != null) { final Path reportDir = globalConfig.getReportDefinitionDir(); dir = reportDir == null ? "" : reportDir.toAbsolutePath().toString(); } return dir; }
private Path getTemplateFile(String templateFileName) { final Path templateDir = globalConfig.getProfileTemplateDir(); return templateDir.resolve(templateFileName); }
/** * @param key the name * @return a DroidGlobalProperty */ public static DroidGlobalProperty forName(String key) { DroidGlobalProperty property = allValues.get(key); return property != null && property.isUserConfigurable() ? property : null; }
private File getProfileHomeDir(ProfileInstance profile) { return new File(config.getProfilesDir(), profile.getUuid()); }
/** * {@inheritDoc} */ @Override public void init(DroidGlobalConfig config) { setEndpointUrl(config.getProperties().getString(DroidGlobalProperty.CONTAINER_UPDATE_URL.getName())); } }
/** * {@inheritDoc} */ @Override public void init(DroidGlobalConfig config) { setEndpointUrl(config.getProperties().getString(DroidGlobalProperty.CONTAINER_UPDATE_URL.getName())); } }
@Override public Object transform(Object id) { ProfileInstance profileInstance = new ProfileInstance(ProfileState.INITIALISING); profileInstance.setUuid((String) id); profileInstance.setThrottle(globalConfig.getProperties() .getInt(DroidGlobalProperty.DEFAULT_THROTTLE.getName())); profileInstance.setHashAlgorithm(globalConfig.getProperties() .getString(DroidGlobalProperty.HASH_ALGORITHM.getName())); profileInstance.setGenerateHash(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.GENERATE_HASH.getName())); profileInstance.setProcessArchiveFiles(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.PROCESS_ARCHIVES.getName())); profileInstance.setProcessWebArchiveFiles(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.PROCESS_WEB_ARCHIVES.getName())); profileInstance.setMaxBytesToScan(globalConfig.getProperties() .getLong(DroidGlobalProperty.MAX_BYTES_TO_SCAN.getName())); profileInstance.setMatchAllExtensions(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.EXTENSION_ALL.getName())); return profileInstance; } }
/** * Generates a URL to an external page from a PUID. * @param puid the puid * @return URL to a resource */ String getPronumURLPrefix(String puid) { // get it from configuration. String puidUrl = droidMainUi.getGlobalContext().getGlobalConfig().getProperties().getString( DroidGlobalProperty.PUID_URL_PATTERN.getName()); return String.format(puidUrl, puid); }
@Override public Object transform(Object id) { ProfileInstance profileInstance = new ProfileInstance(ProfileState.INITIALISING); profileInstance.setUuid((String) id); profileInstance.setThrottle(globalConfig.getProperties() .getInt(DroidGlobalProperty.DEFAULT_THROTTLE.getName())); profileInstance.setHashAlgorithm(globalConfig.getProperties() .getString(DroidGlobalProperty.HASH_ALGORITHM.getName())); profileInstance.setGenerateHash(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.GENERATE_HASH.getName())); profileInstance.setProcessArchiveFiles(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.PROCESS_ARCHIVES.getName())); profileInstance.setProcessWebArchiveFiles(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.PROCESS_WEB_ARCHIVES.getName())); profileInstance.setMaxBytesToScan(globalConfig.getProperties() .getLong(DroidGlobalProperty.MAX_BYTES_TO_SCAN.getName())); profileInstance.setMatchAllExtensions(globalConfig.getProperties() .getBoolean(DroidGlobalProperty.EXTENSION_ALL.getName())); return profileInstance; } }
/** * Generates a URL to an external page from a PUID. * @param puid the puid * @return URL to a resource */ String getPronumURLPrefix(String puid) { // get it from configuration. String puidUrl = droidMainUi.getGlobalContext().getGlobalConfig().getProperties().getString( DroidGlobalProperty.PUID_URL_PATTERN.getName()); return String.format(puidUrl, puid); }