}
if ((!pegRevision.isValid() || pegRevision == SVNRevision.BASE || pegRevision == SVNRevision.WORKING) &&
(!revision.isValid() || revision == SVNRevision.BASE || revision == SVNRevision.WORKING)) {
doGetLocalFileContents(path, dst, revision, expandKeywords);
} else {
SVNRepository repos = createRepository(null, path, null, pegRevision, revision, null);
checkCancelled();
long revNumber = getRevisionNumber(revision, repos, path);
SVNNodeKind kind = repos.checkPath("", revNumber);
if (kind == SVNNodeKind.DIR) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_IS_DIRECTORY,
"URL ''{0}'' refers to a directory", repos.getLocation());
SVNErrorManager.error(err, SVNLogType.WC);
}
checkCancelled();
if (!expandKeywords) {
repos.getFile("", revNumber, null, new SVNCancellableOutputStream(dst, this));
} else {
SVNProperties properties = new SVNProperties();
repos.getFile("", revNumber, properties, null);
checkCancelled();
String keywords = properties.getStringValue(SVNProperty.KEYWORDS);
String eol = properties.getStringValue(SVNProperty.EOL_STYLE);
String charset = SVNTranslator.getCharset(properties.getStringValue(SVNProperty.CHARSET), path.getPath(), getOptions());
if (keywords != null || eol != null || charset != null) {
String cmtRev = properties.getStringValue(SVNProperty.COMMITTED_REVISION);
String cmtDate = properties.getStringValue(SVNProperty.COMMITTED_DATE);
String author = properties.getStringValue(SVNProperty.LAST_AUTHOR);
Map keywordsMap = SVNTranslator.computeKeywords(keywords, expandKeywords ? repos.getLocation().toString() : null, author, cmtDate, cmtRev, getOptions());
OutputStream translatingStream = SVNTranslator.getTranslatingOutputStream(dst, charset, SVNTranslator.getEOL(eol, getOptions()), false, keywordsMap, expandKeywords);
repos.getFile("", revNumber, null, new SVNCancellableOutputStream(translatingStream, getEventDispatcher()));
try {
translatingStream.close();
} catch (IOExceptionWrapper ioew) {
throw ioew.getOriginalException();
} catch (IOException e) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getMessage()), SVNLogType.WC);
}
} else {
repos.getFile("", revNumber, null, new SVNCancellableOutputStream(dst, getEventDispatcher()));
}
}
try {
dst.flush();
} catch (IOException e) {