FileSystem vs FileSystemProvider - vscode-extensions

I am new to vscode extensions API development. I was going through the API documentation when I found FileSystem and FileSystemProvider in order to read a directory's and file's contents. I am finding it hard to understand the differences between the two.
Can someone help me out with when to use FileSystem and FileSystemProvider?

Related

Create network file share from an API

I am exploring the possibilities of exposing an EMC Documentum folder, and the files/folders within, as a network file share.
The reason is so we can enable another application to read and write files to what it thinks is a standard UNC path, but really the repository is in Documentum.
That Documentum product doesn’t seem to offer this, however does expose an API.
A few thoughts here were a bespoke ‘driver’ for SAMBA, possibly something using WebDAV, but really I haven’t investigated these much yet, so both may be unviable.
Basically, how can I wrap an API up to look like a network drive?
I’ll keep self exploring this but hopefully someone can provide some leads here too..?
Update: using FUSE for Linux.
Documentum "folder" as you see it is not something like Windows folder. It is a database record of object with its related properties. Nothing else.
Documentum "documents" are somehow more related to Windows documents but still are only database record of objects with related properties and specific content stored somewhere in storage. Storage can be something like:
file share on Windows / Linux OS
specialized storage soluton like
Centra
specialized storage cloud solution
So you have misunderstanding of what you call Documentum folder. Your requirement can still be achieved in some way, thats for sure.
For example you could make integration between windows folder to Documentum via Spring Intergration framework (SI) from Windows folder side and at Documentum side implement listeners to hook SI and implement BOF (Business Object Framework) services to process events from SI. This is just one of the options.
Technically it is possible to create an interface to Documentum repository using any standard (SMB, CIFS, WebDav, IMAP, .... ) which can represent a document.
The fun task / hard part is mapping Documentum functionality to your chosen standard.
For example: back in 2013 I wrote a basic proof of concept Webdav interface to Documentum repository. I used the Miltion WebDav java library (http://milton.io).
With a WebDav interface, the Documentum Repository was exposed to a Windows computer as a drive using Add Network Location.
We identified that we can use FUSE on Linux.

Show content of a zip file in a browser, rather than downloading it

I have a log server, where users upload archives and view their content online when needed. Currently the server unzips files, right after receiving them. Unfortunately, my peers consumed all the drive space I had. I can free up a lot of space, if there's a way of storing ZIP archives, but feeding them to users as HTML page (same as default Apache's file browser).
I know there are solutions relying on JS, like:
http://gildas-lormeau.github.io/zip.js/demos/demo2.html
https://stuk.github.io/jszip/
or I can unzip them on demand at server side and provide link to a temporary folder. However, some time ago I've heard a browser can view an archive content if proper headers are sent from Apache/nginx. Apache's mod-deflate doesn't help much here and I can't find other docs - perhaps it's not possible after all?
Cheers.

Alfresco webscripts File upload directly to alfresco repository

I've been going through CMIS model in general and how to use Alfresco as CMIS repository in Alfresco Wiki and Documentation(I installed 4.2d on Windows). I am confused about many things but here is what I need to know right now:
Is there any portlet webscript i.e something I can call from my application that opens like a popup or something close available that Alfresco provides to upload files directly to Alfresco repository. If not could anyone point me to the resources from which I could build one. I would like to access repository in CMIS way preferably. There is something in alfresco/services/cmissamples/upload. Can I use that?
I saw that each of the rest URIs can be appended with alf_ticket. But the thing is URIs work even without alf_ticket. How can I make it mandatory and how can I make folders of that user only to be available for browsing or uploading files.
Any links or examples of using Alfresco as only back end repository with own ui of the application will be helpful.
I found that many of the paths in docs/wiki are incorrect.
check this two links. It should give you good pointers on CMIS and webscripts-
http://22ecmoncloud111.blogspot.com/
http://sumantapakira.wordpress.com/
Alfresco provides file upload API to upload file. Please check following link which provides example and more details for the same.
http://basanagowdapatil.blogspot.in/2011/10/how-to-upload-file-to-alfresco-share.html
http://blog.mwrobel.eu/uploading-big-file-alfresco-web-services/

Storing files locally in Node Webkit App

Folks:
I'm creating an app using Node Webkit. The purpose of this app is to display images and pdfs. The app needs to download those files from a central repository, and cache them locally. When the app runs offline, the files should still be available, and displayed.
On the face of it, this sounds like appcache is the answer - and that indeed is where I was heading when this was a pure webapp in a browser. However, now I've discovered node-webkit, and here we are.
node-webkit's GitHub wiki states:
"However, application cache is designed for browser use, for apps using node-webkit, it's less useful than the other two method, read HTML5 Application Cache if you want to use it."
But doesn't say why.
I've also researched node.js filesystem - but that seems like a whole magnitude of complexity above what I need.
Can anyone point me in a sensible direction?
Thanks.
It has to do with the nature of App Cache itself.
You specify a manifest file that lists all the static assets required for your app to run offline. You don't have any programmatic access to the cache to add and remove files via JS.
So for a node-webkit app, it'd make more sense to fetch these files and store them in the Application Support folder (Or AppData, depending on the platform). That's where the node.js part is really useful, the file IO stuff.

How to overwrite read-only files in privileged locations on MacOS?

I'm writing an app that needs to overwrite a read-only file. Specifically the /etc/hosts file. To do that I need to ask for permission from the user to get root access and thereby permission to overwrite the hosts file.
I have searched all over the internet, but I have not been able to understand how to do this. I realize that a method called AuthorizationExecuteWithPrivileges() used to be used for this, but that it is deprecated in OSX 10.7. Then I came across something called SMJobBless, but I really didn't understand the concept of that?
So can you explain how to solve my problem the right way?
Regards, Rasmus
http://atnan.com/blog/2012/02/29/modern-privileged-helper-tools-using-smjobbless-plus-xpc/
SMJobBless + XPC is a os x 10.7+ solution for what you require.
The provided link contains source code showing examples too.