use of org.syncany.operations.daemon.messages.api.FolderResponse in project syncany by syncany.
the class CommandLineClient method handleRestResponse.
private int handleRestResponse(Command command, HttpResponse httpResponse) throws Exception {
logger.log(Level.FINE, "Received HttpResponse: " + httpResponse);
String responseStr = IOUtils.toString(httpResponse.getEntity().getContent());
logger.log(Level.FINE, "Responding to message with responseString: " + responseStr);
Response response = XmlMessageFactory.toResponse(responseStr);
if (response instanceof FolderResponse) {
FolderResponse folderResponse = (FolderResponse) response;
command.printResults(folderResponse.getResult());
return 0;
} else if (response instanceof AlreadySyncingResponse) {
out.println("Daemon is already syncing, please retry later.");
return 1;
} else if (response instanceof BadRequestResponse) {
out.println(response.getMessage());
return 1;
}
return 1;
}
Aggregations