Files REST endpoint: Don't parse non-existing files

Rather fail with ResourceNotFoundException.

This is e.g. important for the GetDiff REST endpoint as it returns an
empty diff for non-existing files. As result the diff screen shows an
empty diff for any non-existing file, but users expect to see an
error.

This change may break existing users of the extension API since the
RevisionApi#file(String) is now throwing RestApiException.

Change-Id: If0c172818b553129145f5ccd2f99e19b94472cce
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-08-22 12:56:20 +02:00
parent 470292b065
commit 0520e08cb6
4 changed files with 39 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ public interface RevisionApi {
Map<String, FileInfo> files() throws RestApiException;
Map<String, FileInfo> files(String base) throws RestApiException;
Map<String, FileInfo> files(int parentNum) throws RestApiException;
FileApi file(String path);
FileApi file(String path) throws RestApiException;
MergeableInfo mergeable() throws RestApiException;
MergeableInfo mergeableOtherBranches() throws RestApiException;