org.glite.security.util
Class CAFilenameSplitter

java.lang.Object
  extended by org.glite.security.util.CAFilenameSplitter

public class CAFilenameSplitter
extends java.lang.Object

Utility class to split the CA filename. E.g. file name "/etc/grid-security/certificates/12adf342.4" would be split into m_baseFilename "/etc/grid-security/certificates/", m_hash "12adf342" and the m_number 4.

Author:
Joni Hahkala

Field Summary
 java.lang.String m_baseFilename
          The filename with path until the last dot that marks the suffix.
 java.lang.String m_hash
          The hash, the filename without path and suffix or last dot.
 int m_number
          The number, following the last dot.
 
Constructor Summary
CAFilenameSplitter()
           
 
Method Summary
static CAFilenameSplitter splitCAFilename(java.lang.String caFilename)
          Splits the filename and gives three fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_baseFilename

public java.lang.String m_baseFilename
The filename with path until the last dot that marks the suffix.


m_hash

public java.lang.String m_hash
The hash, the filename without path and suffix or last dot.


m_number

public int m_number
The number, following the last dot.

Constructor Detail

CAFilenameSplitter

public CAFilenameSplitter()
Method Detail

splitCAFilename

public static CAFilenameSplitter splitCAFilename(java.lang.String caFilename)
                                          throws java.lang.IllegalArgumentException
Splits the filename and gives three fields. The hash code, which should be the filename without the suffix, the suffix number and the hash code with path and without suffix.

Parameters:
caFilename - The CA filename to split. E.g. /etc/grid-security/certificates/12adf342.4
Returns:
The CAFilenameSplitter instance holding the information.
Throws:
java.lang.IllegalArgumentException - Thrown in case the file name does not end with a number suffix.