Search in sources :

Example 1 with GetFileFolderResponse

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);
}
Also used : GetFileFolderResponse(org.syncany.operations.daemon.messages.GetFileFolderResponse) File(java.io.File) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with GetFileFolderResponse

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());
}
Also used : GetFileFolderResponse(org.syncany.operations.daemon.messages.GetFileFolderResponse) Response(org.syncany.operations.daemon.messages.api.Response) Test(org.junit.Test)

Example 3 with GetFileFolderResponse

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());
}
Also used : GetFileFolderResponse(org.syncany.operations.daemon.messages.GetFileFolderResponse) Response(org.syncany.operations.daemon.messages.api.Response) Test(org.junit.Test)

Aggregations

GetFileFolderResponse (org.syncany.operations.daemon.messages.GetFileFolderResponse)3 Test (org.junit.Test)2 Response (org.syncany.operations.daemon.messages.api.Response)2 Subscribe (com.google.common.eventbus.Subscribe)1 File (java.io.File)1