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:com.trafficspaces.api.controller.PlacementConnector.java

public List find(Placement[] placements, Flags flags, String medium, String frame, String title,
        boolean useIframe) throws IOException, TrafficspacesAPIException {

    Properties params = new Properties();
    params.put("request", getRequestJSONObject(placements, flags, medium, frame, title, useIframe).toString());
    return find(params);
}

From source file:de.ingrid.iplug.ckan.Configuration.java

@Override
public void setPropertiesFromPlugdescription(Properties props, PlugdescriptionCommandObject pd) {
    props.put("ckan.url.search", ckanSearchUrl);
    props.put("ckan.url.data", ckanDataUrl);
}

From source file:com.wms.multitenant.config.MasterDatabaseConfig.java

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

From source file:uk.org.funcube.fcdw.config.MailConfig.java

@Bean
JavaMailSenderImpl mailSender() {//  w w w.j av  a  2  s  .co  m
    JavaMailSenderImpl mailSender = new JavaMailSenderImpl();

    mailSender.setHost("smtp.gmail.com");
    mailSender.setPort(587);
    mailSender.setUsername("dave@g4dpz.me.uk");
    mailSender.setPassword("H4les0wen");

    Properties properties = new Properties();
    properties.put("mail.smtp.auth", "true");
    properties.put("mail.smtp.starttls.enable", "true");

    mailSender.setJavaMailProperties(properties);

    return mailSender;
}

From source file:TestSendMail.java

public void testSend() {
    try {//from   ww  w.  j  ava 2 s . co m
        Security.removeProvider(new BouncyCastleProvider().getName());
        Security.addProvider(new BouncyCastleProvider());
        //log.info("Lista de proveedores disponible:"+Arrays.asList(Security.getProviders()));
        org.apache.xml.security.Init.init();
        Properties configuracion = new Properties();
        configuracion.put("HOST_SMTP", "192.168.10.7");

        SendMailUtil.init(configuracion); //benito.galan@avansi.com.do
        MultiPartEmail mail = SendMailUtil.getCurrentInstance().buildMessage("Ejemplo de Firma",
                "rquintero@viavansi.com", "", "<p>rub&eacute;n</p> ", "certificadoavansicxa", "avansicxa");
        mail.setDebug(true);
        // Enviamos 
        String id = mail.send();
        System.out.println(id);
        mail.getMimeMessage().writeTo(System.out);

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

From source file:com.badgersoft.eseoprocessor.config.MailConfig.java

@Bean
JavaMailSenderImpl mailSender() {//from  w  w  w . j a  v a2s. c o m
    JavaMailSenderImpl mailSender = new JavaMailSenderImpl();

    mailSender.setHost("smtp.gmail.com");
    mailSender.setPort(587);
    mailSender.setUsername("dave@g4dpz.me.uk");
    mailSender.setPassword("H4les0wen1234");

    Properties properties = new Properties();
    properties.put("mail.smtp.auth", "true");
    properties.put("mail.smtp.starttls.enable", "true");

    mailSender.setJavaMailProperties(properties);

    return mailSender;
}

From source file:com.badgersoft.nayifprocessor.config.MailConfig.java

@Bean
JavaMailSenderImpl mailSender() {//  www  .  ja  v a 2s  .  com
    JavaMailSenderImpl mailSender = new JavaMailSenderImpl();

    mailSender.setHost("smtp.gmail.com");
    mailSender.setPort(587);
    mailSender.setUsername("dave@g4dpz.me.uk");
    mailSender.setPassword("H4les0wen1234!");

    Properties properties = new Properties();
    properties.put("mail.smtp.auth", "true");
    properties.put("mail.smtp.starttls.enable", "true");

    mailSender.setJavaMailProperties(properties);

    return mailSender;
}

From source file:com.googlecode.flyway.commandline.MainMediumTest.java

@Test
public void loadConfigurationFile() throws Exception {
    Properties properties = new Properties();
    properties.put("existing", "still there!");
    properties.put("override", "loses :-(");

    String filename = new ClassPathResource("test.properties").getFile().getPath();
    String[] args = new String[] { "-configFile=" + filename, "-configFileEncoding=UTF-8" };

    Main.loadConfigurationFile(properties, args);

    assertEquals(4, properties.size());//ww w .ja  v  a 2  s. co m
    assertEquals("still there!", properties.getProperty("existing"));
    assertEquals("rbbit 123", properties.getProperty("roger"));
    assertEquals("wins :-)", properties.getProperty("override"));
}

From source file:org.nekorp.workflow.desktop.servicio.imp.ServicioAlertaEmailTemplate.java

public Session buildSession() {
    Properties props = new Properties();
    props.put("mail.smtp.host", smtpHost);
    props.put("mail.smtp.socketFactory.port", smtpPort);
    props.put("mail.smtp.socketFactory.class", smtpFactoryClass);
    props.put("mail.smtp.socketFactory.fallback", fallBack);
    props.put("mail.smtp.starttls.enable", starttls);
    props.put("mail.smtp.auth", smtpAuth);
    props.put("mail.smtp.port", smtpPort);
    props.put("mail.smtp.debug", debug);

    Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() {
        @Override/*w ww.  ja va  2s . c o m*/
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(user, password);
        }
    });
    return session;
}

From source file:org.socialsignin.showcase.SocialSignInShowcaseWebappConfig.java

@Bean
public HandlerExceptionResolver defaultHandlerExceptionResolver() {
    SimpleMappingExceptionResolver resolver = new SimpleMappingExceptionResolver();
    Properties mappings = new Properties();
    mappings.put("org.socialsignin.springframework.social.security.signin.NonUniqueConnectionException",
            "connect/providerConnect");

    resolver.setDefaultErrorView("exception");

    resolver.setExceptionMappings(mappings);
    return resolver;
}