FileDocCategorySizeDatePackage
ACIF.javaAPI DocphoneME MR2 API (J2ME)4864Wed May 02 18:00:38 BST 2007com.sun.satsa.acl

ACIF

public class ACIF extends PKCS15File
This class represents the SATSA ACIF file abstraction

Fields Summary
private Vector
ACIF
This vector contains parsed objects from ACIF.
private Vector
ACFs
This vector contains the entries from the ACIF file
Constructors Summary
public ACIF(Location location, AclFileSystem files)
Creates AODF object for the pointed location and file system

param
location Location required location
param
files AclFileSystem requred file system


                              
         
        super(location, files);
    
Methods Summary
public intgetACFCount()
Returns number of entries in the ACIF file

return
int

        return ACFs.size();
    
public LocationgetACFPath(int index)
Returns location of the pointed ACF

param
index int index of the required ACF
return
Location of the required ACF

        return ((ACF)ACFs.elementAt(index)).getPath();
    
public byte[]getAID(int index)
Returns AID of the pointed entry (ACF)

param
index int index of required entry
return
byte[] AID of the required entry

        return ((ACF)ACFs.elementAt(index)).getAID();
    
public voidload()
Loads ACIF object from the file system

throws
IOException if I/O error occurs
throws
TLVException if TLV error occurs

        ACIF = new Vector();
        resetLoader(ACIF, null, null);
        parseDF(location.path);
        readACIF();
    
private voidreadACIF()
Reads ACIF data from the ACIF vector.

throws
IOException if I/O error occurs
throws
TLVException if TLV error occurs
It is assumed that the ACIF file contains information about ACF files
in the following format:
SEQUENCE {
OCTET_STRING // aid (Optional)
SEQUENCE {
OCTET_STRING // path
INTEGER // index
CONTEXT_PRIMITIVE_0 { ???
INTEGER // length
}
}
}

        for (int i = 0; i < ACIF.size(); i++) {
            ACF acf = new ACF();
            TLV t = ((TLV)ACIF.elementAt(i)).child;
            if (t.type == TLV.OCTETSTR_TYPE) {         /* aid */
                acf.setAID(t.getValue());
                t = t.next;
            }
            if (t.type == TLV.SEQUENCE_TYPE) {       /* location */
                acf.setPath(files.pathToLocation(t));
            }
            ACFs.addElement(acf);
        }