public void openRoot() throws SVNException { // repo format /root/format FSFile formatFile = new FSFile(getRepositoryFormatFile()); int format = -1; try { format = formatFile.readInt(); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "First line of ''{0}'' contains non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } if (format != REPOSITORY_FORMAT && format != REPOSITORY_FORMAT_LEGACY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_UNSUPPORTED_VERSION, "Expected repository format ''{0}'' or " + "''{1}''; found format ''{2}''", new Object[] {new Integer(REPOSITORY_FORMAT_LEGACY), new Integer(REPOSITORY_FORMAT), new Integer(format)}); SVNErrorManager.error(err, SVNLogType.FSFS); } myReposFormat = format; }
public void openRoot() throws SVNException { // repo format /root/format FSFile formatFile = new FSFile(getRepositoryFormatFile()); int format = -1; try { format = formatFile.readInt(); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "First line of ''{0}'' contains non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } if (format != REPOSITORY_FORMAT && format != REPOSITORY_FORMAT_LEGACY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_UNSUPPORTED_VERSION, "Expected repository format ''{0}'' or " + "''{1}''; found format ''{2}''", new Object[] {new Integer(REPOSITORY_FORMAT_LEGACY), new Integer(REPOSITORY_FORMAT), new Integer(format)}); SVNErrorManager.error(err, SVNLogType.FSFS); } myReposFormat = format; }
public void openRoot() throws SVNException { // repo format /root/format FSFile formatFile = new FSFile(getRepositoryFormatFile()); int format = -1; try { format = formatFile.readInt(); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "First line of ''{0}'' contains non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } if (format != REPOSITORY_FORMAT && format != REPOSITORY_FORMAT_LEGACY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_UNSUPPORTED_VERSION, "Expected repository format ''{0}'' or " + "''{1}''; found format ''{2}''", new Object[] {new Integer(REPOSITORY_FORMAT_LEGACY), new Integer(REPOSITORY_FORMAT), new Integer(format)}); SVNErrorManager.error(err, SVNLogType.FSFS); } myReposFormat = format; }
public int readDBFormat() throws SVNException { int format = -1; // fs format /root/db/format FSFile formatFile = new FSFile(getDBFormatFile()); try { format = formatFile.readInt(); readOptions(formatFile, format); } catch (SVNException svne) { if (svne.getCause() instanceof FileNotFoundException) { format = DB_FORMAT_LOW; myMaxFilesPerDirectory = 0; } else if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.STREAM_UNEXPECTED_EOF) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Can''t read first line of format file ''{0}''", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } else { throw svne; } } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Format file ''{0}'' contains an unexpected non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } return format; }
public int readDBFormat() throws SVNException { int format = -1; // fs format /root/db/format FSFile formatFile = new FSFile(getDBFormatFile()); try { format = formatFile.readInt(); readOptions(formatFile, format); } catch (SVNException svne) { if (svne.getCause() instanceof FileNotFoundException) { format = DB_FORMAT_LOW; } else if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.STREAM_UNEXPECTED_EOF) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Can''t read first line of format file ''{0}''", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } else { throw svne; } } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Format file ''{0}'' contains an unexpected non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } return format; }
public int readDBFormat() throws SVNException { int format = -1; // fs format /root/db/format FSFile formatFile = new FSFile(getDBFormatFile()); try { format = formatFile.readInt(); readOptions(formatFile, format); } catch (SVNException svne) { if (svne.getCause() instanceof FileNotFoundException) { format = DB_FORMAT_LOW; } else if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.STREAM_UNEXPECTED_EOF) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Can''t read first line of format file ''{0}''", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } else { throw svne; } } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_VERSION_FILE_FORMAT, "Format file ''{0}'' contains an unexpected non-digit", formatFile.getFile()); SVNErrorManager.error(err, SVNLogType.FSFS); } finally { formatFile.close(); } return format; }