我无法理解Apache Camel。我需要从Google云端硬盘中删除一个文件。以下是我的代码。骆驼:用Google Drive删除文件
private static List scopes = Arrays.asList(“https://www.googleapis.com/auth/drive.file”);
public static void main(String[] args) throws Exception
{
CamelContext context = new DefaultCamelContext();
GoogleDriveConfiguration configuration = new GoogleDriveConfiguration();
configuration.setApplicationName("camel");
configuration.setClientId("..");
configuration.setClientSecret("..");
configuration.setScopes(scopes);
configuration.setAccessToken("..");
configuration.setRefreshToken("..");
GoogleDriveComponent googleDriveComponent = new GoogleDriveComponent();
googleDriveComponent.setConfiguration(configuration);
context.addComponent("google-drive", googleDriveComponent);
context.addRoutes(
new RouteBuilder()
{
@Override
public void configure() throws Exception
{
from("google-drive://drive-files/delete?fileId=..").log(LoggingLevel.INFO, "${body}");
}
});
context.start();
Thread.sleep(10000);
context.stop();
}}
请指教一下。我究竟做错了什么?
堆栈跟踪:
org.apache.camel.RuntimeCamelException:com.google.api.client.googleapis.json.GoogleJsonResponseException:404未找到 { “代码”:404, “错误”:[ {location}“:”file“, ”locationType“:”other“, ”message“:”File not found:..“, ”reason“:”notFound“ }], “message”:“File not found:..” }
骆驼是关于整合,或帮助他们之间的各种系统的整合。虽然你可以使用驼峰谷歌文档组件,但如果你只是想“在谷歌文档中删除文件”,那么你应该使用别的东西。 –
感谢您的咨询!我的主要任务 - 处理骆驼。我想完成这个程序。 – Tolik