@Test public void storeTo() { String path = new File("target/testing/" + getClass().getSimpleName()).getAbsolutePath(); Properties p = new Properties(); p.setProperty(SessionProfile.KEY_PROVIDER, FileSessionProvider.class.getName()); p.setProperty(SessionProfile.KEY_PREFIX + FileSessionProvider.KEY_DIRECTORY, path); SessionProfile profile = SessionProfile.loadFrom(p, ProfileContext.system(getClass().getClassLoader())); Properties restored = new Properties(); profile.storeTo(restored); assertThat(restored, is(p)); }
public void storeTo(Properties properties) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } LOG.debug("Saving session profile: {}"); PropertiesUtil.checkAbsentKey(properties, KEY_PROVIDER); PropertiesUtil.checkAbsentKeyPrefix(properties, KEY_PREFIX); properties.setProperty(KEY_PROVIDER, providerClass.getName()); for (Map.Entry<String, String> entry : configuration.entrySet()) { properties.setProperty(KEY_PREFIX + entry.getKey(), entry.getValue()); } }
SessionProfile extends BaseProfile<SessionProfile, SessionProvider> { public void storeTo(Properties properties) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } LOG.debug("Saving session profile: {}"); PropertiesUtil.checkAbsentKey(properties, KEY_PROVIDER); PropertiesUtil.checkAbsentKeyPrefix(properties, KEY_PREFIX); properties.setProperty(KEY_PROVIDER, providerClass.getName()); for (Map.Entry<String, String> entry : configuration.entrySet()) { properties.setProperty(KEY_PREFIX + entry.getKey(), entry.getValue()); } } }
SessionProfile extends BaseProfile<SessionProfile, SessionProvider> { public void storeTo(Properties properties) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } LOG.debug("Saving session profile: {}"); PropertiesUtil.checkAbsentKey(properties, KEY_PROVIDER); PropertiesUtil.checkAbsentKeyPrefix(properties, KEY_PREFIX); properties.setProperty(KEY_PROVIDER, providerClass.getName()); for (Map.Entry<String, String> entry : configuration.entrySet()) { properties.setProperty(KEY_PREFIX + entry.getKey(), entry.getValue()); } } SessionProfile(
            Class<? extends SessionProvider> providerClass,
            ProfileContext context,
            Map<String, String> configuration); }
SessionProfile extends BaseProfile<SessionProfile, SessionProvider> { public void storeTo(Properties properties) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } LOG.debug("Saving session profile: {}"); PropertiesUtil.checkAbsentKey(properties, KEY_PROVIDER); PropertiesUtil.checkAbsentKeyPrefix(properties, KEY_PREFIX); properties.setProperty(KEY_PROVIDER, providerClass.getName()); for (Map.Entry<String, String> entry : configuration.entrySet()) { properties.setProperty(KEY_PREFIX + entry.getKey(), entry.getValue()); } } SessionProfile(
            Class<? extends SessionProvider> providerClass,
            ProfileContext context,
            Map<String, String> configuration); @Override Class<? extends SessionProvider> getProviderClass(); @Override ProfileContext getContext(); Map<String, String> getConfiguration(); @Deprecated static SessionProfile loadFrom(Properties properties, ClassLoader loader); static SessionProfile loadFrom(Properties properties, ProfileContext context); void storeTo(Properties properties); static void removeCorrespondingKeys(Properties properties); }
SessionProfile extends BaseProfile<SessionProfile, SessionProvider> { public void storeTo(Properties properties) { if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } LOG.debug("Saving session profile: {}"); PropertiesUtil.checkAbsentKey(properties, KEY_PROVIDER); PropertiesUtil.checkAbsentKeyPrefix(properties, KEY_PREFIX); properties.setProperty(KEY_PROVIDER, providerClass.getName()); for (Map.Entry<String, String> entry : configuration.entrySet()) { properties.setProperty(KEY_PREFIX + entry.getKey(), entry.getValue()); } } SessionProfile(
            Class<? extends SessionProvider> providerClass,
            ProfileContext context,
            Map<String, String> configuration); @Override Class<? extends SessionProvider> getProviderClass(); @Override ProfileContext getContext(); Map<String, String> getConfiguration(); @Deprecated static SessionProfile loadFrom(Properties properties, ClassLoader loader); static SessionProfile loadFrom(Properties properties, ProfileContext context); void storeTo(Properties properties); static void removeCorrespondingKeys(Properties properties); static final String KEY_PROVIDER; static final String KEY_PREFIX; }