Examples of FacebookException


Examples of com.face4j.facebook.exception.FacebookException

    
     int statusCode = client.executeMethod(getMethod);
      if (statusCode != HttpStatus.SC_OK) {
        //FacebookError error = new FacebookError(statusCode, "I guess you are not permitted to access this url. HTTP status code:"+statusCode, null);
        response = getMethod.getResponseBodyAsString();
        throw new FacebookException(JSONToObjectTransformer.getError(response, statusCode));
      }
      response = getMethod.getResponseBodyAsString();
    } catch (HttpException e) {
      throw new FacebookException("Http Exception while calling facebook!",e);
    } catch (IOException e) {
      throw new FacebookException("IO Exception while calling facebook!",e);
    finally {
        getMethod.releaseConnection();
    }
   
    //if response string contains accessToken=xxx remove it!
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

            int statusCode = client.executeMethod(postMethod);
            if (statusCode != HttpStatus.SC_OK) {
              //FacebookError error = new FacebookError(statusCode, "I guess you are not permitted to access this url. HTTP status code:"+statusCode, null);
              response = postMethod.getResponseBodyAsString();
              throw new FacebookException(JSONToObjectTransformer.getError(response, statusCode));
            }
            response = postMethod.getResponseBodyAsString();
        } catch (HttpException e) {
            throw new FacebookException("Http Exception while calling facebook!", e);
        } catch (IOException e) {
            throw new FacebookException("IO Exception while calling facebook!", e);
        } finally {
            postMethod.releaseConnection();
        }

        return response;
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

          }

          int statusCode = client.executeMethod(deleteMethod);
          if (statusCode != HttpStatus.SC_OK) {
            response = deleteMethod.getResponseBodyAsString();
            throw new FacebookException(JSONToObjectTransformer.getError(response, statusCode));
          }
          response = deleteMethod.getResponseBodyAsString();
      } catch (HttpException e) {
          throw new FacebookException("Http Exception while calling facebook!", e);
      } catch (IOException e) {
          throw new FacebookException("IO Exception while calling facebook!", e);
      } finally {
          deleteMethod.releaseConnection();
      }

      return response;
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

      int statusCode = response.getResponseCode();
      if (statusCode != HttpStatus.SC_OK) {
        // FacebookError error = new FacebookError(statusCode,
        // "I guess you are not permitted to access this url. HTTP status code:"+statusCode, null);
        responseString = new String(response.getContent());
        throw new FacebookException(JSONToObjectTransformer.getError(responseString, statusCode));
      }
      responseString = new String(response.getContent());
    } catch (HttpException e) {
      throw new FacebookException("Http Exception while calling facebook!", e);
    } catch (IOException e) {
      throw new FacebookException("IO Exception while calling facebook!", e);
    }

    // if response string contains accessToken=xxx remove it!
    // responseString = Util.replaceAccessToken(responseString, nameValuePairs);
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

      statusCode = connection.getResponseCode();
      if (statusCode != HttpURLConnection.HTTP_OK) {
        // FacebookError error = new FacebookError(statusCode,
        // "I guess you are not permitted to access this url. HTTP status code:"+statusCode, null);
        content = getResponse(connection);
        throw new FacebookException(JSONToObjectTransformer.getError(content, statusCode));
      } else {
        content = getResponse(connection);
      }
    } catch (MalformedURLException e) {
      throw new FacebookException("Malformed URL Exception while calling facebook!", e);
    } catch (IOException e) {
      throw new FacebookException("IOException while calling facebook!", e);
    } finally {
      if (connection != null) {
        connection.disconnect();
      }
    }
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

      statusCode = response.getResponseCode();

      if (statusCode != HttpURLConnection.HTTP_OK) {
        content = new String(response.getContent());
        throw new FacebookException(JSONToObjectTransformer.getError(content, statusCode));
      } else {
        content = new String(response.getContent());
      }

    } catch (IOException e) {
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

   
    try {
      return gson.fromJson(json, e);
    } catch(Exception exception){
      logger.log(Level.SEVERE, "Data received from Facebook for class "+e.getName()+" is "+json,exception);
      throw new FacebookException("Error while converting object. Send this to nischal@grabinbox.com : "+json, exception);
    }
  }
View Full Code Here

Examples of com.face4j.facebook.exception.FacebookException

     
      FacebookError error = null;
      try {
        error = gson.fromJson(json, FacebookError.class);
      } catch(Exception exception){
        throw new FacebookException("Error in converting facebook error to FacebookError object! Facebook data is: "+json,exception);
      }
     
      throw new FacebookException(error);
    }
  }
View Full Code Here

Examples of facebook4j.FacebookException

            }
            if (!json.isNull("unseen")) {
                unseen = getPrimitiveInt("unseen", json);
            }
        } catch (JSONException jsone) {
            throw new FacebookException(jsone.getMessage(), jsone);
        }
    }
View Full Code Here

Examples of facebook4j.FacebookException

            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(messages, list);
            }
            return messages;
        } catch (JSONException jsone) {
            throw new FacebookException(jsone);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.