More closely match the semantics of projectExists

This commit is contained in:
Shane Kilkelly 2018-11-29 11:39:56 +00:00
parent f852cd603d
commit dd2e9b6945

View file

@ -48,9 +48,14 @@ public class SnapshotApiFacade {
Optional<Credential> oauth2, Optional<Credential> oauth2,
String projectName String projectName
) throws FailedConnectionException, GitUserException { ) throws FailedConnectionException, GitUserException {
try {
GetDocResult doc = SnapshotApi GetDocResult doc = SnapshotApi
.getResult(api.getDoc(oauth2, projectName)); .getResult(api.getDoc(oauth2, projectName));
return Optional.ofNullable(doc); doc.getVersionID();
return Optional.of(doc);
} catch (InvalidProjectException e) {
return Optional.empty();
}
} }
public Deque<Snapshot> getSnapshots( public Deque<Snapshot> getSnapshots(