[Owncloud] Porting your apps to the new filesystem API's

Robin Appelman icewind at owncloud.com
Wed Jan 30 21:24:54 UTC 2013


I've just merged my work on the filesystem api and filecache systems[1], if you 
maintain an ownCloud app it's advised to port your app to the new API's.

In order to port your apps a few things have to be taken into account:

OC_Filesystem and OC_FilesystemView have been renamed to \OC\Files\Filesystem 
and \OC\Files\View. For backwards compatibility they are still available under 
their old name for now but that will probably change in the future.

The filesystem cache is accessible with the following functions:
 - \OC\Files\Filesystem::getFileInfo($path)
 - \OC\Files\Filesystem::putFileInfo($path)
 - \OC\Files\Filesystem::getDirectoryContent($path)
 - \OC\Files\Filesystem::search($query)
 - \OC\Files\Filesystem::searchByMime($mimetype) (accepts both 'text/plain' 
and wildcard 'text' style mimetypes)

If you need to access the cache for files outside the user's home directory, 
the same functions are available in \OC\Files\View.

I've already done the basic porting work for the apps in the official apps repo 
but not all of them are tested, please tests your apps properly to ensure they 
are still working correctly on the latest master.

If you run into problems with your app, please send a mail or poke me on irc.

[1]: https://github.com/owncloud/core/pull/673

 - Robin Appelman



More information about the Owncloud mailing list