Package models

Examples of models.LoginResponse


    try {

      if (request.getParameter("action") != null) {

        HttpSession session = request.getSession(true);
        LoginResponse login = (LoginResponse) session.getAttribute(Global.LOGIN);

        if (login != null) {

          //Busca o parametro enviado pelo form
          String action = request.getParameter("action").toLowerCase();
View Full Code Here


          response.setStatus(statusLine.getStatusCode());

          if (statusLine.getStatusCode() < 300) {
            //Em caso de sucesso, armazena as credencias obtidas           
            LoginResponse loginResp = gson.fromJson(data, LoginResponse.class);

            session.setAttribute(Global.LOGIN, loginResp);
            session.setAttribute(Global.USER_NAME, loginResp.getUserInfo().getNome());
          } else {

            PrintWriter out = response.getWriter();
            out.print(data);
          }
View Full Code Here

    try {

      if (request.getParameter("action") != null) {

        HttpSession session = request.getSession(true);
        LoginResponse login = (LoginResponse) session.getAttribute(Global.LOGIN);

        if (login != null) {

          //Busca o parametro enviado pelo form
          String action = request.getParameter("action").toLowerCase();
View Full Code Here

      Gson gson = new Gson();

      if (request.getParameter("documento") != null) {

        HttpSession session = request.getSession(true);
        LoginResponse login = (LoginResponse) session.getAttribute(Global.LOGIN);

        if (login != null) {

          //Busca o parametro enviado pelo form
          DocumentoCreateExternoRequest documento = gson.fromJson(request.getParameter("documento"), DocumentoCreateExternoRequest.class);

          //L� o arquivo enviado
          String fileDir = getFilePath(request, documento.getArquivoNome());

          byte[] fileBytes = Files.readAllBytes(Paths.get(fileDir));

          documento.setBytes(Base64Coder.encode(fileBytes));

          String apiName = CAMINHO_API_DOCUMENTO + "CreateExterno";

          HttpPost httpPost = new HttpPost(Global.ApiPortalBaseURL + apiName);

          httpPost.setHeader(Global.ACS_AUTH_CONTEXT_UID, login.getUidContextos(0));
          httpPost.setHeader(Global.ACS_AUTH_TOKEN, login.getToken());
          httpPost.setHeader(Global.ACS_AUTH_USER_UID, login.getUserInfo().getUid());

          StringEntity entity = new StringEntity(gson.toJson(documento), StandardCharsets.UTF_8);
          entity.setContentType("application/json");
          httpPost.setEntity(entity);
View Full Code Here

TOP

Related Classes of models.LoginResponse

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.