mirror of
https://github.com/nextcloud/documentation.git
synced 2025-08-16 16:07:43 +00:00
Merge pull request #13141 from ronnybremer/patch-1
This commit is contained in:
@ -81,13 +81,12 @@ All methods return a Folder object on which files and folders can be accessed, o
|
||||
try {
|
||||
try {
|
||||
$file = $userFolder->get('myfile.txt');
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$userFolder->touch('myfile.txt');
|
||||
$file = $userFolder->get('myfile.txt');
|
||||
}
|
||||
|
||||
// the id can be accessed by $file->getId();
|
||||
$file->putContent($content);
|
||||
// the id can be accessed by $file->getId();
|
||||
$file->putContent($content);
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$userFolder->newFile('myfile.txt', $content);
|
||||
}
|
||||
|
||||
} catch(\OCP\Files\NotPermittedException $e) {
|
||||
// you have to create this exception by yourself ;)
|
||||
@ -163,4 +162,4 @@ The recommended way of adding your own mounts to the filesystem from an app is i
|
||||
and registering the provider using ``OCP\Files\Config\IMountProviderCollection::registerProvider``.
|
||||
|
||||
Once registered, your provider will be called every time the filesystem is being setup for a user and your mount provider
|
||||
can return a list of mounts to add for that user.
|
||||
can return a list of mounts to add for that user.
|
||||
|
Reference in New Issue
Block a user