if (line == null || line.length() == 0) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.STREAM_UNEXPECTED_EOF, "Reading ''{0}''", formatFile); SVNErrorMessage err1 = SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "''{0}'' is not a working copy", path); err1.setChildErrorMessage(err); SVNErrorManager.error(err1); }
    protected int getVersion(File path) throws SVNException {        File adminDir = new File(path, SVNFileUtil.getAdminDirectoryName());        File formatFile = new File(adminDir, "format");        BufferedReader reader = null;        String line = null;        int formatVersion = -1;                try {            reader = new BufferedReader(new InputStreamReader(SVNFileUtil.openFileForReading(formatFile), "UTF-8"));            line = reader.readLine();        } catch (IOException e) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot read format file ''{0}'': {1}", new Object[] {formatFile, e.getLocalizedMessage()});            SVNErrorManager.error(err, e);        } catch (SVNException svne) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "''{0}'' is not a working copy", path);            err.setChildErrorMessage(svne.getErrorMessage());            SVNErrorManager.error(err, svne);        } finally {            SVNFileUtil.closeFile(reader);        }                try {            formatVersion = Integer.parseInt(line.trim());        } catch (NumberFormatException nfe) {            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "First line of ''{0}'' contains non-digit", formatFile);            SVNErrorMessage err1 = SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "''{0}'' is not a working copy", path);            err1.setChildErrorMessage(err);            SVNErrorManager.error(err1);        }        return formatVersion;    }