// Javadoc inherited
public IResource createPolicy(IPath location, PolicyBuilder policy,
CreatePolicyConfiguration config)
throws PolicyFileAccessException {
try {
JiBXWriter writer = new JiBXWriter(false);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(baos);
writer.write(osw, policy);
InputStream is = new ByteArrayInputStream(baos.toByteArray());
return createNewPolicy(is, location, config.getProgressMonitor(),
policy.getName());
} catch (RepositoryException re) {
throw new PolicyFileAccessException(re);