if (os != null) { try { os.close(); } catch (IOException e) { } }
SVNFileUtil.closeFile(os);
    public static void createVersionedDirectory(File dir) throws SVNException {        dir.mkdirs();        File adminDir = new File(dir, ".svn");        adminDir.mkdirs();        SVNFileUtil.setHidden(adminDir, true);        File format = new File(adminDir, "format");        OutputStream os = null;        if (!format.exists()) {            try {                os = new FileOutputStream(format);                os.write(new byte[] {'4', '\n'});            } catch (IOException e) {                SVNErrorManager.error(0, e);            } finally {                if (os != null) {                     try {                        os.close();                    } catch (IOException e) {                    }                }            }        }        File readme = new File(adminDir, "README.txt");        if (!readme.exists()) {            try {                os = new FileOutputStream(readme);                String eol = System.getProperty("line.separator");                eol = eol == null ? "\n" : eol;                os.write(("This is a Subversion working copy administrative directory." + eol +                 "Visit http://subversion.tigris.org/ for more information." + eol).getBytes());            } catch (IOException e) {                SVNErrorManager.error(0, e);            } finally {                if (os != null) {                     try {                        os.close();                    } catch (IOException e) {                    }                }            }        }        File empty = new File(adminDir, "empty-file");        if (!empty.exists()) {            try {                empty.createNewFile();            } catch (IOException e) {                SVNErrorManager.error(0, e);            }        }        File[] tmp = {                new File(adminDir, "tmp" + File.separatorChar + "props"),                new File(adminDir, "tmp" + File.separatorChar + "prop-base"),                new File(adminDir, "tmp" + File.separatorChar + "text-base"),                new File(adminDir, "tmp" + File.separatorChar + "wcprops"),                new File(adminDir, "props"),                new File(adminDir, "prop-base"),                new File(adminDir, "text-base"),                new File(adminDir, "wcprops")};        for(int i = 0; i < tmp.length; i++) {            if (!tmp[i].exists()) {                tmp[i].mkdirs();            }        }    }