Package org.syncany.operations.daemon.messages

Examples of org.syncany.operations.daemon.messages.BadRequestResponse


      daemonWebServer.putCacheWebSocketRequest(request.getId(), clientSocket);     
      eventBus.post(request);
    }
    catch (Exception e) {
      logger.log(Level.WARNING, "Invalid request received; cannot serialize to Request.", e);
      eventBus.post(new BadRequestResponse(-1, "Invalid request."));
    }
  }
View Full Code Here


        IOUtils.copy(new FileInputStream(tempFile), exchange.getOutputStream());       
        exchange.endExchange();
      }
      else {
        logger.log(Level.WARNING, "Invalid request received; Cannot find file token " + tempFileToken);
        eventBus.post(new BadRequestResponse(-1, "Invalid request."));
      }
    }
    else
      String message = IOUtils.toString(exchange.getInputStream()); // TODO [high] Read entire file to memory. Dangerous!
      logger.log(Level.INFO, "REST message received: " + message);
 
      try {
        Request request = MessageFactory.toRequest(message);
 
        daemonWebServer.putCacheRestRequest(request.getId(), exchange);       
        eventBus.post(request);
      }
      catch (Exception e) {
        logger.log(Level.WARNING, "Invalid request received; cannot serialize to Request.", e);
        eventBus.post(new BadRequestResponse(-1, "Invalid request."));
      }
    }
  }
View Full Code Here

  @Subscribe
  public void onFolderRequestReceived(FolderRequest folderRequest) {
    File rootFolder = new File(folderRequest.getRoot());
   
    if (!watchOperations.containsKey(rootFolder)) {
      eventBus.post(new BadRequestResponse(folderRequest.getId(), "Unknown root folder."));
    }
  }
View Full Code Here

          logger.log(Level.WARNING, "FolderRequest discarded : ", folderRequest);
          eventBus.post(new AlreadySyncingResponse(folderRequest.getId(), "FolderRequest discarded."));
        }
      }
      catch (Exception e) {
        eventBus.post(new BadRequestResponse(folderRequest.getId(), "Invalid request."));
      }
    }   
  } 
View Full Code Here

TOP

Related Classes of org.syncany.operations.daemon.messages.BadRequestResponse

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.