0

我不是Java開發人員,但我需要自動爲我的Google網域創建電子郵件導出,並且只支持.NET和Java。具體來說,我試圖複製在這裏提供的代碼片段:https://developers.google.com/google-apps/email-audit/#creating_a_mailbox_for_export利用Google的應用程序爲您的域名

不幸的是,我得到我無法解決以下進口:

import com.google.gdata.client.appsforyourdomain.audit.AuditService; 
import com.google.gdata.client.appsforyourdomain.audit.MailBoxDumpRequest; 
import com.google.gdata.data.appsforyourdomain.generic.GenericEntry; 

奇怪的是此導入的工作原理:

import com.google.gdata.client.appsforyourdomain.AppsForYourDomainService; 

我我嘗試了使用最新的可用下載庫和源代碼庫中的庫,但都沒有運氣。對於我對Java進口和包裝的誤解抱有歉意,但是我希望能夠解決上述三種進口問題。

回答

1

不幸的是我無法解決Java中的問題。但是,在調查API的Python實現之後,我能夠很好地匹配PyDoc信息的功能。

最初的目標是導出Gmail郵箱內容。該解決方案,在Python,如下:你需要

from gdata.apps.audit.service import AuditService 
audit_service = AuditService(domain="example.com") 
audit_service.ClientLogin(admin_user, passwd) 
audit_service.createMailboxExportRequest(user="target_user") 

#check the status 
audit_service.getAllMailboxExportRequestsStatus() 

作爲典型的谷歌/ GDATA的注意事項,以確保您的用戶帳戶具有相應的權限,已啓用的服務,API被授權使用該服務,GDATA是安裝,更新和在您的PYTHONPATH中,並且您已經上傳了GPG密鑰來加密數據。

相關問題