try { SVNFileUtil.rename(myTmpFile, myFile); SVNFileUtil.setReadonly(myFile, true); } catch (IOException e) { SVNErrorManager.error(0, e); }
    public void save() throws SVNException {        OutputStream os = null;         try {            os = new FileOutputStream(myTmpFile);            for (Iterator commands = myCache.iterator(); commands.hasNext();) {                Map command = (Map) commands.next();                String name = (String) command.remove("");                os.write('<');                os.write(name.getBytes("UTF-8"));                os.write('\n');                for (Iterator attrs = command.keySet().iterator(); attrs.hasNext();) {                    String attr = (String) attrs.next();                    String value = (String) command.get(attr);                    value = SVNTranslator.xmlEncode(value);                    os.write(' ');                    os.write(' ');                    os.write(' ');                    os.write(attr.getBytes("UTF-8"));                    os.write('=');                    os.write('\"');                    os.write(value.getBytes("UTF-8"));                    os.write('\"');                    if (!attrs.hasNext()) {                        os.write('/');                        os.write('>');                    }                    os.write('\n');                }            }            SVNFileUtil.rename(myTmpFile, myFile);            SVNFileUtil.setReadonly(myFile, true);        } catch (IOException e) {            SVNErrorManager.error(0, e);        } finally {            if (os != null) {                try {                    os.close();                } catch (IOException e) {                }            }            myCache = null;        }    }