File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 1111use OCP \Files \File ;
1212use OCP \Files \Folder ;
1313use OCP \Files \NotFoundException ;
14+ use OCP \Files \NotPermittedException ;
1415use OCP \Files \StorageInvalidException ;
1516use OCP \IL10N ;
1617
1718class WorkspaceService {
18- private IL10N $ l10n ;
19-
2019 private const SUPPORTED_STATIC_FILENAMES = [
2120 'Readme.md ' ,
2221 'README.md ' ,
2322 'readme.md '
2423 ];
2524
26- public function __construct (IL10N $ l10n ) {
27- $ this ->l10n = $ l10n ;
25+ public function __construct (
26+ private readonly IL10N $ l10n ,
27+ ) {
2828 }
2929
3030 public function getFile (Folder $ folder ): ?File {
3131 foreach ($ this ->getSupportedFilenames () as $ filename ) {
3232 try {
33- $ exists = $ folder ->getStorage ()->getCache ()->get ($ folder ->getInternalPath () . '/ ' . $ filename );
34- if ($ exists ) {
35- $ file = $ folder ->get ($ filename );
36- if ($ file instanceof File) {
37- return $ file ;
38- }
33+ $ file = $ folder ->get ($ filename );
34+ if ($ file instanceof File) {
35+ return $ file ;
3936 }
40- } catch (NotFoundException |StorageInvalidException ) {
37+ } catch (NotFoundException |NotPermittedException | StorageInvalidException ) {
4138 continue ;
4239 }
4340 }
You can’t perform that action at this time.
0 commit comments