org.openpermis.examples.ldap
Class CertIntoLdifUtil

java.lang.Object
  extended by org.openpermis.examples.ldap.CertIntoLdifUtil

public final class CertIntoLdifUtil
extends Object

This utility class substitutes in the given ldif file the given place holder with the given certificate.

Since:
0.3.0

Field Summary
(package private) static int ARGUMENT_NUMBER
           
(package private) static int BUFFER_SIZE
           
 
Constructor Summary
private CertIntoLdifUtil()
           
 
Method Summary
private static String getCertificateInBase64(String certificateFilePath)
           
static void main(String[] args)
          Substitutes in the given ldif file the given place holder with the given certificate.
private static String readFileAsString(String filePath)
           
private static String substitutePlaceholderWithCertificate(String inputStr, String patternStr, String replacementStr)
           
private static void writeStringToFile(String encodedCertificate, String filePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

static final int BUFFER_SIZE
Constant Field Value:
1024
Since:
0.3.0

ARGUMENT_NUMBER

static final int ARGUMENT_NUMBER
Constant Field Value:
3
Since:
0.3.0
Constructor Detail

CertIntoLdifUtil

private CertIntoLdifUtil()
Since:
0.3.0
Method Detail

main

public static void main(String[] args)
                 throws IOException
Substitutes in the given ldif file the given place holder with the given certificate.

Parameters:
args - "#1 argument: path of ldif file, #2 argument: place holder within ldif file, #3 argument: path of certificate file
Throws:
IOException - if something goes awry.
Since:
0.3.0

substitutePlaceholderWithCertificate

private static String substitutePlaceholderWithCertificate(String inputStr,
                                                           String patternStr,
                                                           String replacementStr)
Since:
0.3.0

getCertificateInBase64

private static String getCertificateInBase64(String certificateFilePath)
                                      throws IOException
Throws:
IOException
Since:
0.3.0

readFileAsString

private static String readFileAsString(String filePath)
                                throws IOException
Throws:
IOException
Since:
0.3.0

writeStringToFile

private static void writeStringToFile(String encodedCertificate,
                                      String filePath)
                               throws IOException
Throws:
IOException
Since:
0.3.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:18:22
Copyright (c) 2002-2007 Ergon Informatik AG