if (! new File(path).exists())
{
return;
}
inputStream = new FileInputStream(path);
ASN1Reader reader = ASN1.getReader(inputStream);
// The first element in the file should be a sequence of object class
// sets. Each object class set will itself be a sequence of octet
// strings, where the first one is the token and the remaining elements
// are the names of the associated object classes.
reader.readStartSequence();
while(reader.hasNextElement())
{
reader.readStartSequence();
ByteSequence token = reader.readOctetString();
LinkedHashMap<ObjectClass,String> ocMap =
new LinkedHashMap<ObjectClass,String>();
while(reader.hasNextElement())
{
String ocName = reader.readOctetStringAsString();
String lowerName = toLowerCase(ocName);
ObjectClass oc = DirectoryServer.getObjectClass(lowerName, true);
ocMap.put(oc, ocName);
}
reader.readEndSequence();
ocEncodeMap.put(ocMap, token);
ocDecodeMap.put(token, ocMap);
}
reader.readEndSequence();
// The second element in the file should be an integer element that holds
// the value to use to initialize the object class counter.
ocCounter.set((int)reader.readInteger());
// The third element in the file should be a sequence of attribute
// description components. Each attribute description component will
// itself be a sequence of octet strings, where the first one is the
// token, the second is the attribute name, and all remaining elements are
// the attribute options.
reader.readStartSequence();
while(reader.hasNextElement())
{
reader.readStartSequence();
ByteSequence token = reader.readOctetString();
String attrName = reader.readOctetStringAsString();
String lowerName = toLowerCase(attrName);
AttributeType attrType =
DirectoryServer.getAttributeType(lowerName, true);
LinkedHashSet<String> options =
new LinkedHashSet<String>();
while(reader.hasNextElement())
{
options.add(reader.readOctetStringAsString());
}
reader.readEndSequence();
atDecodeMap.put(token, attrType);
aoDecodeMap.put(token, options);
ConcurrentHashMap<Set<String>, ByteSequence> map = adEncodeMap
.get(attrType);
if (map == null)
{
map = new ConcurrentHashMap<Set<String>, ByteSequence>(1);
map.put(options, token);
adEncodeMap.put(attrType, map);
}
else
{
map.put(options, token);
}
}
reader.readEndSequence();
// The fourth element in the file should be an integer element that holds
// the value to use to initialize the attribute description counter.
adCounter.set((int)reader.readInteger());
}
catch (Exception e)
{
if (debugEnabled())
{