Googleドキュメントには構造体があります:
Folder1
+------Folder1-1
+------+------File1-1-1
+------Folder1-2
+------File1-1
Folder2
.Net google api ライブラリ( Google Data API SDK )を使用して「File1-1」を「Folder2」に移動したい
public static void moveFolder(string szUserName, string szPassword, string szResouceID, string szToFolderResourceID)
{
string szSouceUrl = "https://docs.google.com/feeds/default/private/full"
+ "/" + HttpContext.Current.Server.UrlEncode(szResouceID);
Uri sourceUri = new Uri(szSouceUrl);
//create a atom entry
AtomEntry atom = new AtomEntry();
atom.Id = new AtomId(szSouceUrl);
string szTargetUrl = "http://docs.google.com/feeds/default/private/full/folder%3Aroot/contents/";
if (szToFolderResourceID != "")
{
szTargetUrl = "https://docs.google.com/feeds/default/private/full"
+ "/" + HttpContext.Current.Server.UrlEncode(szToFolderResourceID)
+ "/contents"
;
}
Uri targetUri = new Uri(szTargetUrl);
DocumentsService service = new DocumentsService(SERVICENAME);
((GDataRequestFactory)service.RequestFactory).KeepAlive = false;
service.setUserCredentials(szUserName, szPassword);
service.EntrySend(targetUri, atom, GDataRequestType.Insert);
}
この関数を実行した後、私は持っています:
Folder1
+------Folder1-1
+------+------File1-1-1
+------Folder1-2
+------File1-1
Folder2
+------File1-1
「Folder1」と「Folder2」の両方に「File1-1」が表示されており、あるフォルダから削除すると別のフォルダで削除されてしまいます。(期待: "File1-1" は "Folder2" にのみ表示されます)
何が起きましたか?どうすればこの問題を解決できますか?