我無法理解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