File src/de/openrat/client/util/HttpStatus.java
Last commit: Fri Sep 30 22:45:01 2016 +0200 dankert first version of the java api.
1 package de.openrat.client.util; 2 3 public class HttpStatus 4 { 5 6 private int statusCode; 7 private String serverMessage; 8 9 public HttpStatus(int statusCode, String serverMessage) 10 { 11 super(); 12 this.statusCode = statusCode; 13 this.serverMessage = serverMessage; 14 } 15 16 public boolean isSuccess() 17 { 18 return statusCode / 100 == 2; 19 } 20 21 public boolean isRedirect() 22 { 23 return statusCode / 100 == 3; 24 } 25 26 public boolean isClientError() 27 { 28 return statusCode / 100 == 4; 29 } 30 31 public boolean isServerError() 32 { 33 return statusCode / 100 == 5; 34 } 35 36 /** 37 * Inhalt des Feldes <code>statusCode</code>. 38 * 39 * @return statusCode 40 */ 41 public int getStatusCode() 42 { 43 return statusCode; 44 } 45 46 /** 47 * Inhalt des Feldes <code>serverMessage</code>. 48 * 49 * @return serverMessage 50 */ 51 public String getServerMessage() 52 { 53 return serverMessage; 54 } 55 56 }
Downloadsrc/de/openrat/client/util/HttpStatus.java
History Fri, 30 Sep 2016 22:45:01 +0200 dankert first version of the java api.