(refs #534)Allow to download large file

This commit is contained in:
Naoki Takezoe
2015-05-02 23:09:18 +09:00
parent baab243bc8
commit 83980fdccd

View File

@@ -294,9 +294,9 @@ trait RepositoryViewerControllerBase extends ControllerBase {
getPathObjectId(git, path, revCommit).map { objectId =>
if(raw){
// Download
defining(JGitUtil.getContentFromId(git, objectId, false).get){ bytes =>
JGitUtil.getContentFromId(git, objectId, true).map {bytes =>
RawData(FileUtil.getContentType(path, bytes), bytes)
}
} getOrElse NotFound
} else {
html.blob(id, repository, path.split("/").toList, JGitUtil.getContentInfo(git, path, objectId),
new JGitUtil.CommitInfo(lastModifiedCommit), hasWritePermission(repository.owner, repository.name, context.loginAccount))