if ((c != null) && !replace) {
if (c != null && !replace) {
    public boolean saveWorkflow(String name, WorkflowDescriptor descriptor, boolean replace) throws FactoryException {        WorkflowConfig c = (WorkflowConfig) workflows.get(name);        if ((c != null) && !replace) {            return false;        }        if (c == null) {            throw new UnsupportedOperationException("Saving of new workflow is not currently supported");        }        Writer out;        descriptor.validate();        try {            out = new OutputStreamWriter(new FileOutputStream(c.url.getFile() + ".new"), "utf-8");        } catch (FileNotFoundException ex) {            throw new FactoryException("Could not create new file to save workflow " + c.url.getFile());        } catch (UnsupportedEncodingException ex) {            throw new FactoryException("utf-8 encoding not supported, contact your JVM vendor!");        }        writeXML(descriptor, out);        //write it out to a new file, to ensure we don't end up with a messed up file if we're interrupted halfway for some reason        //now lets rename        File original = new File(c.url.getFile());        File backup = new File(c.url.getFile() + ".bak");        File updated = new File(c.url.getFile() + ".new");        boolean isOK = !original.exists() || original.renameTo(backup);        if (!isOK) {            throw new FactoryException("Unable to backup original workflow file " + original + " to " + backup + ", aborting save");        }        isOK = updated.renameTo(original);        if (!isOK) {            throw new FactoryException("Unable to rename new  workflow file " + updated + " to " + original + ", aborting save");        }        backup.delete();        return true;    }