* @throws org.elasticsearch.ElasticsearchException
*/
private void validate(SnapshotRequest request, ClusterState state) throws ElasticsearchException {
RepositoriesMetaData repositoriesMetaData = state.getMetaData().custom(RepositoriesMetaData.TYPE);
if (repositoriesMetaData == null || repositoriesMetaData.repository(request.repository()) == null) {
throw new RepositoryMissingException(request.repository());
}
if (!Strings.hasLength(request.name())) {
throw new InvalidSnapshotNameException(new SnapshotId(request.repository(), request.name()), "cannot be empty");
}
if (request.name().contains(" ")) {