use of org.syncany.operations.daemon.messages.GetFileFolderResponse in project syncany by syncany.
the class WebServer method onGetFileResponseInternal.
@Subscribe
public void onGetFileResponseInternal(GetFileFolderResponseInternal fileResponseInternal) {
File tempFile = fileResponseInternal.getTempFile();
GetFileFolderResponse fileResponse = fileResponseInternal.getFileResponse();
fileTokenTempFileCache.asMap().put(fileResponse.getTempToken(), tempFile);
eventBus.post(fileResponse);
}
use of org.syncany.operations.daemon.messages.GetFileFolderResponse in project syncany by syncany.
the class XmlMessageFactoryTest method testXmlToResponseSuccess.
@Test
public void testXmlToResponseSuccess() throws Exception {
Response response = XmlMessageFactory.toResponse("<getFileFolderResponse><code>200</code><requestId>1234</requestId><root>/some/path</root><tempFileToken>beefbeefbeef</tempFileToken></getFileFolderResponse>");
assertEquals(GetFileFolderResponse.class, response.getClass());
assertEquals(200, ((GetFileFolderResponse) response).getCode());
assertEquals((Integer) 1234, ((GetFileFolderResponse) response).getRequestId());
assertEquals("beefbeefbeef", ((GetFileFolderResponse) response).getTempToken());
}
use of org.syncany.operations.daemon.messages.GetFileFolderResponse in project syncany by syncany.
the class JsonMessageFactoryTest method testJsonToResponseSuccess.
@Test
public void testJsonToResponseSuccess() throws Exception {
Response response = JsonMessageFactory.toResponse("{\"GetFileFolderResponse\":{\"code\":\"200\",\"requestId\":\"1234\",\"root\":\"/some/path\",\"tempFileToken\":\"beefbeefbeef\"}}");
assertEquals(GetFileFolderResponse.class, response.getClass());
assertEquals(200, ((GetFileFolderResponse) response).getCode());
assertEquals((Integer) 1234, ((GetFileFolderResponse) response).getRequestId());
assertEquals("beefbeefbeef", ((GetFileFolderResponse) response).getTempToken());
}
Aggregations