Package com.almilli.movierentals

Examples of com.almilli.movierentals.LoginException


                String result = login.getResponseBodyAsString();
                login.releaseConnection();

                if (result.indexOf("Site Unavailable") != -1) {
                    String pattern = RESOURCES.getString("login.siteUnavailable");
                    throw new LoginException(MessageFormat.format(pattern, getName()));
                }
               
                if (result.indexOf("password combination is invalid") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
                if (result.indexOf("We could not find your login information") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
                if (result.indexOf("Sign In") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
               
                if (code >= 400 && result.indexOf("Movies in Queue") == -1) {
                    String pattern = RESOURCES.getString("login.internalError");
                    throw new LoginException(MessageFormat.format(pattern, getName()));
                }
       
      } catch (IOException e) {
                LoginException io = new LoginException("A server error occurred when logging in user.");
        io.initCause(e);
        throw io;
      }
           
            //now force the queue to be synced up so that we will know what is in the queue
            //and what isn't
View Full Code Here


               
                String result = login.getResponseBodyAsString();
                login.releaseConnection();
               
                if (result.indexOf("does not match an account in our records") != -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
               
                if (code >= 400 && result.indexOf("http://www.netflix.com/Logout") == -1) {
                    throw new LoginException(RESOURCES.getString("login.invalidUserPass"));
                }
       
      } catch (IOException e) {
                LoginException io = new LoginException("Unable to login");
        io.initCause(e);
        throw io;
      }
           
            //now sync the queue so we know what is in it
            syncQueue();
View Full Code Here

TOP

Related Classes of com.almilli.movierentals.LoginException

Copyright © 2018 www.massapicom. 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.