File tree Expand file tree Collapse file tree
private/Files/ObjectStore
public/Files/ObjectStore/Events Expand file tree Collapse file tree Original file line number Diff line number Diff line change 460460 'OCP \\Files \\Notify \\IChange ' => $ baseDir . '/lib/public/Files/Notify/IChange.php ' ,
461461 'OCP \\Files \\Notify \\INotifyHandler ' => $ baseDir . '/lib/public/Files/Notify/INotifyHandler.php ' ,
462462 'OCP \\Files \\Notify \\IRenameChange ' => $ baseDir . '/lib/public/Files/Notify/IRenameChange.php ' ,
463+ 'OCP \\Files \\ObjectStore \\Events \\BucketCreatedEvent ' => $ baseDir . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php ' ,
463464 'OCP \\Files \\ObjectStore \\IObjectStore ' => $ baseDir . '/lib/public/Files/ObjectStore/IObjectStore.php ' ,
464465 'OCP \\Files \\ObjectStore \\IObjectStoreMultiPartUpload ' => $ baseDir . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php ' ,
465466 'OCP \\Files \\ReservedWordException ' => $ baseDir . '/lib/public/Files/ReservedWordException.php ' ,
Original file line number Diff line number Diff line change @@ -509,6 +509,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
509509 'OCP \\Files \\Notify \\IChange ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/IChange.php ' ,
510510 'OCP \\Files \\Notify \\INotifyHandler ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/INotifyHandler.php ' ,
511511 'OCP \\Files \\Notify \\IRenameChange ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/IRenameChange.php ' ,
512+ 'OCP \\Files \\ObjectStore \\Events \\BucketCreatedEvent ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php ' ,
512513 'OCP \\Files \\ObjectStore \\IObjectStore ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/IObjectStore.php ' ,
513514 'OCP \\Files \\ObjectStore \\IObjectStoreMultiPartUpload ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php ' ,
514515 'OCP \\Files \\ReservedWordException ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ReservedWordException.php ' ,
Original file line number Diff line number Diff line change 1313use Aws \S3 \S3Client ;
1414use GuzzleHttp \Promise \Create ;
1515use GuzzleHttp \Promise \RejectedPromise ;
16+ use OCP \EventDispatcher \IEventDispatcher ;
17+ use OCP \Files \ObjectStore \Events \BucketCreatedEvent ;
1618use OCP \Files \StorageNotAvailableException ;
1719use OCP \ICertificateManager ;
1820use OCP \Server ;
@@ -140,6 +142,13 @@ public function getConnection() {
140142 throw new StorageNotAvailableException ('The bucket will not be created because the name is not dns compatible, please correct it: ' . $ this ->bucket );
141143 }
142144 $ this ->connection ->createBucket (['Bucket ' => $ this ->bucket ]);
145+ Server::get (IEventDispatcher::class)
146+ ->dispatchTyped (new BucketCreatedEvent (
147+ $ this ->bucket ,
148+ $ options ['endpoint ' ],
149+ $ options ['region ' ],
150+ $ options ['version ' ]
151+ ));
143152 $ this ->testTimeout ();
144153 } catch (S3Exception $ e ) {
145154 $ logger ->debug ('Invalid remote storage. ' , [
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+ * SPDX-License-Identifier: AGPL-3.0-only
8+ */
9+ namespace OCP \Files \ObjectStore \Events ;
10+
11+ use OCP \EventDispatcher \Event ;
12+
13+ /**
14+ * @since 29.0.16
15+ */
16+ class BucketCreatedEvent extends Event {
17+
18+ public function __construct (
19+ private readonly string $ bucket ,
20+ private readonly string $ endpoint ,
21+ private readonly string $ region ,
22+ private readonly string $ version = 'latest ' ,
23+ ) {
24+ parent ::__construct ();
25+ }
26+
27+ public function getBucket (): string {
28+ return $ this ->bucket ;
29+ }
30+
31+ public function getEndpoint (): string {
32+ return $ this ->endpoint ;
33+ }
34+
35+ public function getRegion (): string {
36+ return $ this ->region ;
37+ }
38+
39+ public function getVersion (): string {
40+ return $ this ->version ;
41+ }
42+ }
You can’t perform that action at this time.
0 commit comments