I use rest api "https://api.onedrive.com/v1.0/drive/root/view.delta?token=***" "reference page" to get oneDrive files changes, it work for add file or folder or delete, but i need to get old path and new path for move, and get old name and new name for renamed file or folder.
Is there any way to get the rename and move changes?
The API doesn't return / track the old-state of items.
To accomplish this, you need to maintain that state in a cache by tracking items with their unique identifier. You can then process the changes coming from the delta API, and when the change record is returned to you, you can evaluate your current state vs. the new state provided by the delta API, and use that to have the old-name and new-name, or old-path and new-path.
Related
I have tried the prestage content way to get packages for some of my new distribution point and I was wondering if it was any possibility to get the revision version of the .pkgx application created.
In that way, I will be able to see if my .pkgx have to be updated.
Create a .ini file and save the information you get while creating the .pkgx application (like the revision).
In that case, you'll be able to test the revision and "update" it(delete the .pkgx and create a new one).
Each time a file is edited (Pdf, Google doc, ect.) there is a new revision. By default, Google drive deletes file revisions older than 30 days or 100 versions... How can I switch this off?
My end goal is keep all revisions of all files stored in Google drive.
I found this resource, but I don't know how to implement it yet. Would you please walk me through?
How to use the "KeepRevisionForever" property to keep all file versions
Thank you so much!
You want to set keepRevisionForever to true for the existing file.
For this, you can achieve this using the method of "Files: update" in Drive API.
Also, you can test the method at "Try this API".
Access to "Try this API" and set keepRevisionForever to true, then, when you set the file ID and click "EXECUTE" button, keepRevisionForever of file is set to true.
But in the current stage, unfortunately, it seems that there are no methods for checking whether keepRevisionForever of the file has already been true.
I've experimented with several ways on seeing if I need to update my user's UITableView data source only if the server one is newer. Over the past few years I've done these scenarios: 1: Having a seperate .txt file with a character as the version # then simply comparing them through code and downloading the new .plist, then saving that .txt to the user's NSDocumentDirectory along with the .plist to compare again in the future, and 2: Actually checking the server's file modification date, which worked even better, as there was no .txt file to download along with the .plist (the less stuff to download the better)
But, now I want to try a different way to account for the fact that I ship a .plist file in the App Bundle. Since the .plist file creation date is always later then the server date for new users, they don't get the new .plist file, whereas older users of the app get the new file. Sure, on the first app launch I could grab the server's modification date and overwrite the app's since I copy it from the main bundle to the NSDocumentDirectory, but I don't think I want to go that route, as I've never liked checking launch counts.
Basically, it needs to continue to be lightweight in network request time and be reliable like it's been for me. I was thinking about creating a version # key in my .plist and simply comparing that with the local .plist, but I highly doubt this will be as lightweight, as I would have to download the whole .plist into an NSDictionary first before I can compare the key values.
I'm really sorry this post is long, and I appreciate your help!
Why not ship the app with out the data_source.plist file and download it on first launch, or any other time it does not exist on disk (you never know). After that, you could send a HEAD request and check the modification date (maybe even the e-tag), and download as necessary.
UPDATE:
Depending on how much control you have over the server, you could add a hash of the file to the response headers (as mentioned in the comments: MD5,SHA*) along side Last-Modified.
You could add the data_source.plist to the bundle at build time, along with last_modified.plist where you can set the hash, last modified, and any other meta data you want, as starting point.
Checking for updates could look something like:
Send HEAD request for http://server.com/data_source.plist
Pull Last-Modified (and hash if you can send it) from the response headers
Validate against corresponding values in last_modifed.plist
Download updated data_source.plist if needed
If the download was successful, update last_modifed.plist with new meta data (last modified and has, be sure pull this from actual download response headers).
This way, the user has something to start with, and the app can download the resource when needed.
The advantage of a HEAD request is it is light weight since there is no message body, but returns the same response headers as a GET request. It is a common method to check if a resource has been updated. The trick with your scenario is to get a starting point onto the device at build time.
Honest to say, I haven't been able to deeply look inside the Google Drive API so far but I wonder if the API has support for what I need. I would like to capture changes under a specific folder and notify the users which has access to that folder.
For example, I have a folder named Foo and there are three people who have access to that folder. When Person 1 makes a notable change (uploads a file, changes a file, deletes a file, etc) under that folder, I would like to notify the Person 2 and Person 3.
Please note here that these changes can be done from anywhere, not just
from my client. The person can take the action through the Google Drive web
interface or the user might be syncing his/her computer with the
Google Drive.
The only part I cannot visualize in my head is how to capture the changes under a specific folder.
For the record, I will be using .NET for my client.
What you're looking for is the changes feed in our just-launched Drive SDK v2. However, the changes feed does not yet support retrieving changes for just a specific folder. Instead, it gives all changes to a user's entire Drive. This is a feature request that we're considering implementing, but I don't have a timeline as to when we'll implement this yet.
Our project saves the model in xml resource file. The xml resource tags get listed as nodes in project explorer. This project is part of source control and been worked upon by multiple users. I am able to handle all enotifications and take appropriate actions when user performs the changes in his workspace. Though when other users change the model file, and the new synced file is obtained in other workspace, I get only notification that xml file was modified. What exact model changes were done is not received.
Things work fine if user closes and open the project.Though this is not the right solution. I tried doing resource.unload followed by resource.load.This didn't make any difference. How can I achieve the desired result programmaticaly?
EMF Compare should be able to help you in comparing two files, but I'm not sure if it integrates well with SCMs.