在 GoogleDrive 中编辑文档后,LastModified 值似乎有时不会立即更改。看起来该值将在几分钟内更新。
我试图通过 DriveSDK 获取文档的 Etag,它也发生在 Etag 值上。
这种奇怪的行为使我无法实时获取文档状态(修改与否)。任何建议将不胜感激。
[示例请求和响应] 请求只是 GoogleDrive ListFiles :https ://www.googleapis.com/drive/v2/files
这是响应 JSON 的部分,您可以看到 ModifiedDate 早于 ModifiedByMeDate。
{
"kind": "drive#fileList",
"etag": "\"3NNCnvnQuji-pODa6SMQ6atlc3M/oKnf21kAcJKTCIycS597xCSR2bk\"",
"selfLink": "https://www.googleapis.com/drive/v2/files",
"items": [
{
"kind": "drive#file",
"id": "1lZjcJIf3Chuu5upFqtiqfTRnRw7*****rFL_tlO8A",
"etag": "\"3NNCnvnQuji-pODa6SMQ6atlc3M/MTM1NDY5MzMyMzQ1Mg\"",
"selfLink": "https://www.googleapis.com/drive/v2/files/1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A",
"alternateLink": "https://docs.google.com/a/*****.com/document/d/1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A/edit",
"embedLink": "https://docs.google.com/a/*****.com/document/d/1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A/preview",
"iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_11_document_list.png",
"thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1lZjcJIf3Chuu5upFqtiq*****7wSUjbRurFL_tlO8A&v=22&s=AMedNnoAAAAAU*****UK74n3UiIg0L4TY-NwP3EaAU&sz=s220",
"title": "TestFile",
"mimeType": "application/vnd.google-apps.document",
"labels": {
"starred": false,
"hidden": false,
"trashed": false,
"restricted": false,
"viewed": true
},
"createdDate": "2012-07-24T08:14:13.918Z",
"modifiedDate": "2012-12-06T01:49:57.982Z",
"modifiedByMeDate": "2012-12-06T01:49:57.982Z",
"lastViewedByMeDate": "2012-12-06T01:50:06.974Z",
"parents": [
{
"kind": "drive#parentReference",
"id": "0AJ-aGTt-gWksUk9PVA",
"selfLink": "https://www.googleapis.com/drive/v2/files/1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A/parents/0AJ-aGTt-gWksUk9PVA",
"parentLink": "https://www.googleapis.com/drive/v2/files/0AJ-aGTt-gWksUk9PVA",
"isRoot": true
}
],
"exportLinks": {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "https://docs.google.com/feeds/download/documents/export/Export?id=1l*****huu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A&exportFormat=docx",
"application/vnd.oasis.opendocument.text": "https://docs.google.com/feeds/download/documents/export/Export?id=1lZjcJIf3Chuu5upF*****SUjbRurFL_tlO8A&exportFormat=odt",
"text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUj*****L_tlO8A&exportFormat=html",
"application/rtf": "https://docs.google.com/feeds/download/documents/export/Export?id=1lZjcJIf3Chuu5upFqtiq*****SUjbRurFL_tlO8A&exportFormat=rtf",
"text/plain": "https://docs.google.com/feeds/download/documents/export/Export?id=1lZjcJIf3Chuu5upFqtiqf*****SUjbRurFL_tlO8A&exportFormat=txt",
"application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=1lZjcJIf3C*****fTRnRw7wSUjbRurFL_tlO8A&exportFormat=pdf"
},
"userPermission": {
"kind": "drive#permission",
"etag": "\"3NNCnvnQuji-pODa6SMQ6atlc3M/6LfqbkrWujmUe1WSDkyhTxdIUCc\"",
"id": "me",
"selfLink": "https://www.googleapis.com/drive/v2/files/1lZjcJIf3Chuu5upFqtiqfTRnRw7wSUjbRurFL_tlO8A/permissions/me",
"role": "owner",
"type": "user"
},
"quotaBytesUsed": "0",
"ownerNames": [
"***** *****"
],
"lastModifyingUserName": "***** *****",
"editable": true,
"writersCanShare": true,
"appDataContents": false
},