class SshUtils implements InitializingBean {

    @Override
    public void afterPropertiesSet() throws Exception {
        certificate = File.createTempFile(UUID.randomUUID().toString(), ".tmp");

        InputStream certificateStreamOriginal = getClass().getResourceAsStream("/id_rsa.ppk");
        FileOutputStream certificateStreamWorkingFile = new FileOutputStream(certificate);

        IOUtils.copy(certificateStreamOriginal, certificateStreamWorkingFile);

        IOUtils.closeQuietly(certificateStreamOriginal);
        IOUtils.closeQuietly(certificateStreamWorkingFile);
    }

}