Refactored classes in thematically packages
[facebook-errors] / src / main / java / de / juplo / facebook / GraphApiException.java
diff --git a/src/main/java/de/juplo/facebook/GraphApiException.java b/src/main/java/de/juplo/facebook/GraphApiException.java
deleted file mode 100644 (file)
index 18eaf81..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-package de.juplo.facebook;
-
-import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
-
-/**
- * Base exception for Facebook Graph-Api exceptions.
- * 
- * @author Kai Moritz
- */
-@org.codehaus.jackson.map.annotate.JsonDeserialize(using = GraphApiExceptionJackson1Deserializer.class)
-@com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = GraphApiExceptionJackson2Deserializer.class)
-public class GraphApiException extends OAuth2Exception
-{
-  private final String type;
-  private final int code;
-
-  private int httpErrorCode;
-
-
-  public GraphApiException(String message, String type, int code)
-  {
-    super(message);
-    this.type = type;
-    this.code = code;
-  }
-
-
-  public String getType()
-  {
-    return type;
-  }
-
-  public int getCode()
-  {
-    return code;
-  }
-
-  @Override
-  public int getHttpErrorCode()
-  {
-    return httpErrorCode == 0 ? super.getHttpErrorCode() : httpErrorCode;
-  }
-
-  public void setHttpErrorCode(int httpErrorCode)
-  {
-    this.httpErrorCode = httpErrorCode;
-  }
-
-  @Override
-  public String toString()
-  {
-    StringBuilder builder = new StringBuilder();
-    builder.append("{error:{\"message\":\"");
-    builder.append(getMessage().replaceAll("\"", "\\\""));
-    builder.append("\",\"type\":");
-    builder.append(type.replaceAll("\"", "\\\""));
-    builder.append("\",\"code\":");
-    builder.append(code);
-    builder.append("}}");
-    return builder.toString();
-  }
-}