Code example for FileOutputStream

Methods: write

0
        dir.mkdirs();
        dir.setReadable(true, false);
        dir.setExecutable(true, false);
        OutputStream os = null;
        try { 
            os = new FileOutputStream(file);
            os.write(cert.getEncoded());
        } finally { 
            IoUtils.closeQuietly(os);
        } 
        file.setReadable(true, false);
    } 
 
    private boolean isDeletedSystemCertificate(X509Certificate x) {
        return getCertificateFile(deletedDir, x).exists();
    } 
 
    public Date getCreationDate(String alias) {
        // containsAlias check ensures the later fileForAlias result 
        // was not a deleted system cert. 
        if (!containsAlias(alias)) {