public Service registerLocalAuthority(
String sParentID, String sSubsegment, Service[] oServices,
String[] oInternals, String[] oExternals)
throws StoreException
{
Service oAuth = null;
synchronized (this)
{
String sFile = getSubSegmentDir(sParentID, sSubsegment);
File oNodeDir = new File(sFile);
if (oNodeDir.exists())
{
throw new StoreException(
Util.KEY_DUPNAME, "Subsegment already exists");
}
else if (!oNodeDir.mkdir())
{
throw new StoreException(
Util.KEY_DBERR,
"Unable to create dir: " + oNodeDir.getPath());
}
oAuth = createAuthority();
// write the local auth
File oDataFile = new File(oNodeDir, ssLocalExt);
String sContents = oAuth.getProviderID();
writeFile(oDataFile, sContents);
// write the date
oDataFile = new File(oNodeDir, ssDateExt);
sContents = getDate();