We are using Apple's new api NSFileProviderReplicatedExtension to implement a file provider extension.
We can use this extension to synchronize files from a remote file server.When there are changes on the server,we can signal workingset to update the local copy.
But when a directory with many files is deleted on the server, we can't delete this directory by calling observer.didDeleteItems.Can someone give me some advice?
The Apple's documents is here:enter link description here
Related
I would like to set the permission on the folder C:\Share\Project\Project1 (and the previous one if needed) to let a specific user "Bob" create modify and read files but I don't want anybody to be able to delete files. Those folder are shared via an ad and Bob acces them following this path \WIN-SRV1\Share\Project\Project 1. I have all the permission on those deviceS both Bob and the hosting server are on windows.
I think i tried every advanced security permission settings for david and everyone etc, and advanced shared setting
Thank you in advance:)
I have developed a small web application that runs a web server in golang.
Each user can login, view the list of their docs (previously uploaded) and click on an item to view an html page that shows some fields of the document plus an tag with a src attribute
The src attribute includes an url like "mydocuments/download/123-456-789.pdf"
On the server side I handle the URL ("mydocuments/download/*") via an http Handler
mymux.HandleFunc(pat.Get("/mydocuments/download/:docname"), DocDownloadHandler)
where:
I check that the user has the rights to view the document in the url
Then I create a fileserver that obviously re-maps the url to the real path of the folder where the files are stored on the filesystem of the server
fileServer := http.StripPrefix("/mydocs/download/",http.FileServer(http.Dir("/the-real-path-to-documents-folder/user-specific-folder/)))
and of course I serve the files
fileServer.ServeHTTP(w, r)
IMPORTANT: the directory where the documents are stored is not the static-files directory I sue for the website but a directory where all files end after being uploaded by users.
My QUESTION
As I am trying to convert the code for it to work also on Google Cloud, I am trying to change the code so that files are stored in a bucket (or, better in "sub-directories" -as they do not properly exist- of a bucket).
How can I modify the code so to map the real document url as available via the cloud storage bucket?
Can I still use the http.FileServer technique above (if so what should I use instead of http.Dir to map the bucket "sub-folder" path where the documents are stored)?
I hope I was enough clear to explain my issue...
I apologise in advance for any unclear point...
Some options are:
Give the user direct access to the resource using a signed URL.
Write code to proxy the request to GCS.
Use http.FS with an fs.FS backed by GCS.
It's possible that a fs.FS for GCS already exists, but you may need to write one.
You can use http.FileSystem since it is an interface and can be implemented however you like.
I could not find the location in my phone for the data stored when using the App-inventor Companion. Can somebody help me in this?
The "AppInventor>assets" contains the pictures used in the app when using the companion but there is no database. I am using TinyDB.
to delete the assets, delete the directory /AppInventor on your device using a file manager app
to delete TinyDB, use the method TinyDB.ClearAll
I have created two refresh tokens for me:
one for
SCOPE = 'https://www.googleapis.com/auth/drive'
and another
SCOPE = 'https://www.googleapis.com/auth/drive.file'
I'm trying to get information about files (using get method)
Some files I can get when using SCOPE drive.files, and some only when using wider scope drive
But I can not figure out what is the reason for that? Files are located in different folders but have one shared root folder.
The difference is that 'drive.file' only gives you permission to files that your app has created or the user has explicitly shared with your app, whereas 'drive' gives your app permission to see the all the files in the user's drive.
See
https://developers.google.com/drive/web/scopes
You should really look into using drive.file, that is where they are trying to push users. I was just fighting with this myself and found that if you use the drive.file scope, you can then subsequently open the file that is chosen using the API for the file type, but only if you set the correct AppID.
See here: https://developers.google.com/picker/docs/#gdata
This allows you to get past the 404 error that you get if you don't set the AppID.
I'm working on an Windows Phone 7 app where I'm going to show ATM's nere your location with bing maps.
I have an xml-file with addresses and gps coordinates. But how do I add this file to my program from visual studio? If I set BuildAction to Content and Copy to output directory to Copy always. The file still isn't in IsolatedStorage. Do I have to build a mechanism to download the information from the web? Or is there another way?
Files listed as content in the Visual Studio project are copied to the generated XAP file (which is analogous to a ZIP file). They are not copied to isolated storage.
In the case of an XML file, you can call XmlReader.Create with the path to the file as argument, as follows:
using (XmlReader reader = XmlReader.Create("path/to/file.xml"))
{
// read XML file here
}
Or you can also call Application.GetResourceStream and use the Stream property of the returned StreamResourceInfo object:
StreamResourceInfo sri = Application.GetResourceStream(
new Uri("path/to/file.xml", UriKind.Relative));
// read XML file here from sri.Stream, e.g. using a StreamReader object
You cannot directly pass files to the isolated storage at design time. Only when the application is running.
I'd still recommend passing the file to the application through a web service. Mainly because if eventually you will need to change the contents of the XML, you will need to update the application.
What I would do is simply create a WCF service that will return serialized data (or the existing XML) via a simple HTTP request.
The "Mango" SDK ships with the ISETool that can take and restore snapshots of an application's isolated storage to/from a local directory:
# Copy data from IS to directory
ISETool.exe ts xd <PRODUCT-ID> "C:\TempDirectory\IsolatedStore"
# Copy data from IS to directory
ISETool.exe rs xd <PRODUCT-ID> "C:\TempDirectory\IsolatedStore"
If you don't want to overwrite the entire IS, the tool supports an option (device-folder) for specifying a sub-directory to backup/restore.