use of com.google.api.services.drive.model.File in project camel by apache.
the class AbstractGoogleDriveTestSupport method uploadTestFolder.
protected File uploadTestFolder() {
File fileMetadata = new File();
fileMetadata.setTitle("testfolder");
fileMetadata.setMimeType("application/vnd.google-apps.folder");
File result = requestBody("google-drive://drive-files/insert?inBody=content", fileMetadata);
return result;
}
use of com.google.api.services.drive.model.File in project camel by apache.
the class DriveFilesIntegrationTest method testPatch.
@Test
public void testPatch() throws Exception {
File file = uploadTestFile();
// lets update the filename
file.setTitle(UPLOAD_FILE.getName() + "PATCHED");
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", file.getId());
// parameter type is String
headers.put("CamelGoogleDrive.fields", "title");
// parameter type is com.google.api.services.drive.model.File
headers.put("CamelGoogleDrive.content", file);
File result = requestBodyAndHeaders("direct://PATCH", null, headers);
assertNotNull("patch result", result);
assertEquals(UPLOAD_FILE.getName() + "PATCHED", result.getTitle());
LOG.debug("patch: " + result);
}
use of com.google.api.services.drive.model.File in project camel by apache.
the class DriveFilesIntegrationTest method testGet.
@Test
public void testGet() throws Exception {
File testFile = uploadTestFile();
String fileId = testFile.getId();
// using String message body for single parameter "fileId"
final File result = requestBody("direct://GET", fileId);
assertNotNull("get result", result);
LOG.debug("get: " + result);
}
use of com.google.api.services.drive.model.File in project camel by apache.
the class DriveFilesIntegrationTest method testUpdate.
@Test
public void testUpdate() throws Exception {
File theTestFile = uploadTestFile();
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", theTestFile.getId());
// parameter type is com.google.api.services.drive.model.File
headers.put("CamelGoogleDrive.content", theTestFile);
File result = requestBodyAndHeaders("direct://UPDATE", null, headers);
assertNotNull("update result", result);
LOG.debug("update: " + result);
}
use of com.google.api.services.drive.model.File in project camel by apache.
the class DriveFilesIntegrationTest method testInsert1.
@Test
public void testInsert1() throws Exception {
File result = uploadTestFile();
assertNotNull("insert result", result);
LOG.debug("insert: " + result);
}
Aggregations