CONFIG_DIR_NAME + File.separator +
COMPRESSED_SCHEMA_FILE_NAME;
String tempPath = path + ".tmp";
outputStream = new FileOutputStream(tempPath);
ASN1Writer writer = ASN1.getWriter(outputStream);
// 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.
writer.writeStartSequence();
for (Map.Entry<ByteSequence,Map<ObjectClass,String>> mapEntry :
ocDecodeMap.entrySet())
{
writer.writeStartSequence();
writer.writeOctetString(mapEntry.getKey());
Map<ObjectClass,String> ocMap = mapEntry.getValue();
for (String ocName : ocMap.values())
{
writer.writeOctetString(ocName);
}
writer.writeEndSequence();
}
writer.writeEndSequence();
// The second element in the file should be an integer element that holds
// the value to use to initialize the object class counter.
writer.writeInteger(ocCounter.get());
// 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.
writer.writeStartSequence();
for (ByteSequence token : atDecodeMap.keySet())
{
writer.writeStartSequence();
AttributeType attrType = atDecodeMap.get(token);
Set<String> options = aoDecodeMap.get(token);
writer.writeOctetString(token);
writer.writeOctetString(attrType.getNameOrOID());
for (String option : options)
{
writer.writeOctetString(option);
}
writer.writeEndSequence();
}
writer.writeEndSequence();
// The fourth element in the file should be an integer element that holds
// the value to use to initialize the attribute description counter.
writer.writeInteger(adCounter.get());
// Close the writer and swing the temp file into place.
outputStream.close();
File liveFile = new File(path);