Example usage for java.util Properties put

List of usage examples for java.util Properties put

Introduction

In this page you can find the example usage for java.util Properties put.

Prototype

@Override
    public synchronized Object put(Object key, Object value) 

Source Link

Usage

From source file:org.springframework.social.vkontakte.api.impl.SecureTemplate.java

public void sendNotification(Collection<String> userIds, String message) {
    requireAuthorization();/*from   w w  w .j  av  a  2s  .  c  o m*/
    Properties props = new Properties();
    props.put("user_ids", StringUtils.collectionToCommaDelimitedString(userIds));
    props.put("message", message);

    // see documentation under http://vk.com/dev/secure.sendNotification
    URI uri = makeOperationURL("secure.sendNotification", props, ApiVersion.VERSION_5_8);

    VKGenericResponse response = restTemplate.getForObject(uri, VKGenericResponse.class);
    checkForError(response);
}

From source file:org.iternine.jeppetto.testsupport.DynamoDBDatabaseProvider.java

@Override
public Properties modifyProperties(Properties properties) {
    properties.put("dynamodb.endpoint",
            String.format("http://localhost:%s", System.getProperty("dynamodb.port")));

    return properties;
}

From source file:com.gumgum.kafka.consumer.KafkaConsumerFactory.java

@ManagedOperation(description = "Initialize Consumer Configuration")
public void initializeConsumerConfig() {
    Properties props = new Properties();
    props.put("zk.connect", zkConnectionString);
    props.put("zk.connectiontimeout.ms", "1000000");
    props.put("groupid", groupName);
    props.put("fetch.size", fetchSize.toString());
    this.consumerConfig = new ConsumerConfig(props);
}

From source file:SendMailBean.java

public void emailPassword(String email, String memberName, String password) {
    String host = "mail";
    String from = "w@j.com";

    Properties props = System.getProperties();

    props.put("mail.smtp.host", host);
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);

    try {/*from   ww  w .ja  v  a 2 s  .  c o  m*/
        message.setFrom(new InternetAddress(from));
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(email));

        message.setSubject("Password Reminder");

        message.setText("Hi " + memberName + ",\nYour password is: " + password + "\nregards - " + from);
        Transport.send(message);
    } catch (AddressException ae) {
    } catch (MessagingException me) {
    }
}

From source file:edu.neu.webtoolsfinal.config.RepositoryConfiguration.java

private Properties getHibernateProperties() {
    Properties properties = new Properties();
    properties.put("hibernate.show_sql", "true");
    properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
    properties.put("hibernate.hbm2ddl.auto", "update");

    return properties;
}

From source file:eagle.storage.TestDataStorageLoader.java

@Test
public void testDataStorage() throws IllegalDataStorageTypeException, IllegalDataStorageException {
    DataStorage dataStorage = DataStorageManager.newDataStorage("test");
    assert dataStorage instanceof TestDataStorage;

    // get eagle.storage.type (value: test) from src/test/resources/application.conf
    DataStorage dataStorage2 = DataStorageManager.getDataStorageByEagleConfig();
    assert dataStorage2 instanceof TestDataStorage;

    AbstractConfiguration configuration = new CombinedConfiguration();
    configuration.addProperty(DataStorageManager.EAGLE_STORAGE_TYPE, "test");
    DataStorage dataStorage3 = DataStorageManager.newDataStorage(configuration);
    assert dataStorage3 instanceof TestDataStorage;

    Properties properties = new Properties();
    properties.put(DataStorageManager.EAGLE_STORAGE_TYPE, "test");
    DataStorage dataStorage4 = DataStorageManager.newDataStorage(properties);
    assert dataStorage4 instanceof TestDataStorage;
}

From source file:ar.com.zauber.garfio.modules.mantis.model.MantisTrackerSessionProvider.java

public TrackerSession getTrackerSession(final String repository, final String username,
        final CommentFormatter commentFormatter) {
    final Properties config = new Properties();
    config.put(GARFIO_CONFIG_URL, garfioURL);
    config.put(GARFIO_CONFIG_PASS, garfioPassword);
    return module.getTrackerSession(commentFormatter, username, config);
}

From source file:org.globus.security.provider.FileBasedKeyStoreTest.java

@Test
public void testIO() throws Exception {
    InputStream is;//from  w ww . j  a v a  2  s  . c o m
    ByteArrayOutputStream os;
    Properties props = new Properties();
    props.put(PEMKeyStore.KEY_FILENAME, "classpath:/key.pem");
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    props.store(baos, "sample");
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    keystore.engineLoad(bais, null);
    Enumeration en = keystore.engineAliases();
    while (en.hasMoreElements()) {
        System.out.println("en.nextElement().toString() = " + en.nextElement().toString());
    }
    os = new ByteArrayOutputStream();
    //        keystore.engineStore(os, null);

    //        keystore.engineStore(os, password);
}

From source file:com.espertech.esper.regression.event.TestMapEventInvalidConfig.java

public void testInvalidConfig() {
    Properties properties = new Properties();
    properties.put("astring", "XXXX");

    Configuration configuration = SupportConfigFactory.getConfiguration();
    configuration.addEventType("MyInvalidEvent", properties);

    try {/* w  w  w  .ja va2s . c o m*/
        EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(configuration);
        epService.initialize();
        fail();
    } catch (ConfigurationException ex) {
        // expected
    }

    EPServiceProvider epService = EPServiceProviderManager
            .getDefaultProvider(SupportConfigFactory.getConfiguration());
    epService.initialize();
}

From source file:com.kerjapraktek.dataalumni.SpringConfiguration.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactory.setDataSource(dataSource);
    Properties jpaProperties = new Properties();
    jpaProperties.put("hibernate.hbm2ddl.auto", "create-drop");
    jpaProperties.put("hibernate.show_sql", "true");
    entityManagerFactory.setJpaProperties(jpaProperties);
    entityManagerFactory.setPackagesToScan("com.kerjapraktek.dataalumni.entities");
    entityManagerFactory.setPersistenceProvider(new HibernatePersistenceProvider());
    return entityManagerFactory;
}