Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / files / KeyOrderingException.java
blob99f2f4e17d9665484c1e3f017ec71e02ed5a1b2d
1 // Copyright 2010 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.files;
5 import com.google.apphosting.api.ApiProxy;
7 import java.io.IOException;
9 /**
10 * A {@code KeyOrderingException} is thrown by the method
11 * {@link FileWriteChannel#write(java.nio.ByteBuffer, String)
12 * FileWriteChannel.write(ByteBuffer, String)} if the {@code sequenceKey}
13 * parameter is not {@code null} and the backend system already has recorded a
14 * last good sequence key for the file and {@code sequenceKey} is not
15 * lexicographically strictly greater than the last good sequence key. The last
16 * good sequence key may then be retrieved via the method
17 * {@link #getLastGoodSequenceKey()}
20 public class KeyOrderingException extends IOException {
22 private static final long serialVersionUID = -5617087691243967742L;
23 private String lastGoodSequenceKey;
25 KeyOrderingException() {
28 KeyOrderingException(String message, ApiProxy.ApplicationException cause) {
29 super(message, cause);
30 lastGoodSequenceKey = cause.getErrorDetail();
33 KeyOrderingException(String message, String lastGoodSequenceKey) {
34 super(message);
35 this.lastGoodSequenceKey = lastGoodSequenceKey;
38 public String getLastGoodSequenceKey() {
39 return lastGoodSequenceKey;