Yandex.Disk received
SDK . Now you can conveniently use its capabilities in applications for OS X and Windows, exactly as in mobile applications on iOS, Android and Windows Phone. In addition, we have developed special
widgets so that any website can easily implement the work with the Disk. (For example, upload files directly to the user’s Ya. Disk) right on the spot.
Immediately, I note that we used the open WebDAV protocol before, so in our applications it was possible to integrate with the Disk almost from the very beginning. But now there are more opportunities for this, and most importantly, it will become much more convenient and simple.
Also, besides the SDK and widgets, there is another important innovation -
deduplication of files downloaded via WebDAV. Now, if some user has already downloaded such a file, then for you it will be downloaded instantly.
')

I told all this yesterday in my
presentation at the Yet Another Conference, and now I want to reveal the details on Habré especially for you.
Deduplication via WebDAV
Initially, to interact with the Disk, we made
our own implementation of the open protocol WebDAV. This is the standard protocol for working with files. It is based on HTTP. For push notifications, xmpp is used. It is through these protocols that all our and third-party clients work. In addition, via WebDAV, disk access can be obtained directly through the file managers built into the system.

But in our official client there is one interesting feature that has not yet been available to third-party developers: file deduplication. On the client side, we can calculate two checksums of a file, and from this information (as well as by size), we can see whether such a file has not already been uploaded to our server. And if we already have this file, it can be downloaded almost instantly. Or rather, the file is not loaded at all, and on the server side, the meta-information is simply updated, and access to the file is opened to the new user. More information about the new feature can be found in the
documentation .

API & SDK
We love WebDAV very much and are not going to give it up. It is already used in many third-party applications (we carefully collect information on them on
this page ). But this protocol has its own problems. First of all, of course, problems in implementations for different platforms. In addition, WebDAV is designed specifically for working with files, and we would like to provide users and developers with something more.
Today, mobile applications often replace or supplement websites. Where previously the developer simply made the site, now a set of applications is being made. Multiplatform is becoming increasingly important, you need to support not only physical storage, but also cloud. And you need to store not only files but also data. We understand that WebDAV in this case is not the most convenient thing. In this regard, we decided to prepare a new API-platform, which includes a full-fledged Disk REST API for working with files.
But just to make a new API seemed to us a little. Developers need an SDK. After all, working with the network is not the most pleasant thing. Constantly process network requests, watch them break or not break. Especially in mobile devices, where communication is generally a big problem. Well, besides the application itself, you need to write a backend, tie an API to work with the network to it, put a server in the data center (or better, just two in different data centers), set up a database for them. It is much better when there is a ready-made library and storage that can be used anywhere, rather than creating anew for each service. That is why we made and run the
Disk SDK .

In version 0.1 there are only tools for working with the network and files, we will add the ability to interact with the database later. At the moment, our SDK supports three programming languages: Java, Objective-C, and C #. Thus, it can be used to create applications under all popular platforms: both mobile and desktop.

We ourselves are going to actively use the SDK inside Yandex. But any external developer has something to save by using such wonderful things. We have prepared detailed
documentation , so you can start working with the SDK right now.
Widgets
Previously, most people had one computer each. Usually it was a desktop or laptop. All files were stored on his hard drive. Sometimes it was the CCP. You saved any file from the Internet to your disk, and then everything was clear. But now there are a lot of such devices (computers at work and at home, smartphones, tablets), the task of saving the file has become significantly more complicated. Each file is on your device, you need to remember what was saved and where. And today, cloud storage is a new implementation of the hard disk, where you can save all permanently used files, and access them from anywhere and from any device. It is with this idea in our head that we developed Yandex.Disk in its original form.
And since we are saying that the Disk is a new storage for all the user's main files, why not give the opportunity to save files from the Internet directly to the Disk? Or vice versa download files directly from it? We decided to implement this with
widgets . We tested them in Mail, Photos, as well as our other services and decided to make them available to any site. You can embed a widget to save files now, and the download widget will appear soon.

Many of the files that users download are scanned one or two times, after which they are deleted, or gathering dust in the download folder. With the help of our widget, such files can not be downloaded, but viewed online. We have viewers for many popular file types.