
nl.tweeenveertig.openstack.headers.object.conditional.IfMatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joss Show documentation
Show all versions of joss Show documentation
Java Client library for OpenStack Storage (Swift)
package nl.tweeenveertig.openstack.headers.object.conditional;
import nl.tweeenveertig.openstack.exception.HttpStatusExceptionUtil;
import org.apache.http.HttpStatus;
public class IfMatch extends AbstractIfMatch {
public static final String IF_MATCH = "If-Match";
public IfMatch(String value) {
super(value);
}
@Override
public void matchAgainst(String matchValue) {
if (!getHeaderValue().equals(matchValue)) {
HttpStatusExceptionUtil.throwException(HttpStatus.SC_PRECONDITION_FAILED);
}
}
@Override
public String getHeaderName() {
return IF_MATCH;
}
}