}
// dump it
OutputStream os = null;
try {
final AdditionalDeployments additionalDeployments;
if (config.exists() && config.length() > 0) {
final InputStream fis = IO.read(config);
try {
additionalDeployments = JaxbOpenejb.unmarshal(AdditionalDeployments.class, fis);
} finally {
IO.close(fis);
}
} else {
additionalDeployments = new AdditionalDeployments();
}
if (add) {
if (!additionalDeployments.getDeployments().contains(deps)) {
additionalDeployments.getDeployments().add(deps);
}
} else {
final Iterator<Deployments> it = additionalDeployments.getDeployments().iterator();
while (it.hasNext()) {
final Deployments current = it.next();
if (deps.getDir() != null && deps.getDir().equals(current.getDir())) {
it.remove();
break;