throw new RepositoryException("Can't back up configuration on path "
+ PrivilegedFileHelper.getAbsolutePath(sourceConfig));
saveStream = PrivilegedFileHelper.fileOutputStream(sourceConfig);
}
IBindingFactory bfact;
try
{
bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
return BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
}
});
}
catch (PrivilegedActionException pae)
{
Throwable cause = pae.getCause();
if (cause instanceof JiBXException)
{
throw (JiBXException)cause;
}
else if (cause instanceof RuntimeException)
{
throw (RuntimeException)cause;
}
else
{
throw new RuntimeException(cause);
}
}
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.marshalDocument(this, "ISO-8859-1", null, saveStream);
saveStream.close();
// writing configuration in to the persister