Package org.jasypt.properties

Examples of org.jasypt.properties.EncryptableProperties.load()


      // Clear all properties and reload properties file
      properties.clear();
      Assert.assertNull(properties.getProperty("PASSWORD"));
      Assert.assertNull(properties.getProperty("LOGIN"));
      fis = new FileInputStream(f);
      properties.load(fis);
      // Valid properties stored value, the property decryption value is
      // realized on the fly the EncryptableProperties object...
      Assert.assertEquals(TEXT_TO_ENCRYPT, properties.getProperty("PASSWORD"));
      Assert.assertEquals("MY_LOGIN", properties.getProperty("LOGIN"));
    } finally {
View Full Code Here


        URL baseUrl = JasyptExample.class.getClassLoader().getResource(".");
        File rootClassPath = new File(baseUrl.getFile());
        for( String next : rootClassPath.list() ) {
            if(next.endsWith(".conf")) {
                try {
                    properties.load(new FileReader(baseUrl.getFile() + next));
                } catch (IOException e) {
                    log.error("Unable to read properties file {}", baseUrl.getFile() + next);
                }
            }
        }
View Full Code Here

        encryptor.setPassword("secret");

        Properties props = new EncryptableProperties(encryptor);
        URL url = JasyptTest.class.getClassLoader().getResource("secret.conf");

        props.load(new FileInputStream(url.getFile()));

        String message = props.getProperty("encrypted");

        assertEquals("super secret message", message);
View Full Code Here

        encryptor.setConfig(config);

        Properties props = new EncryptableProperties(encryptor);
        URL url = JasyptTest.class.getClassLoader().getResource("secret.conf");

        props.load(new FileInputStream(url.getFile()));
        String message;

        try {
            message = props.getProperty("encrypted");
        } catch (NullPointerException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.