File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 ;
1514use OCP \Files \StorageInvalidException ;
1615use OCP \IL10N ;
1716
1817class WorkspaceService {
18+ private IL10N $ l10n ;
19+
1920 private const SUPPORTED_STATIC_FILENAMES = [
2021 'Readme.md ' ,
2122 'README.md ' ,
2223 'readme.md '
2324 ];
2425
25- public function __construct (
26- private readonly IL10N $ l10n ,
27- ) {
26+ public function __construct (IL10N $ l10n ) {
27+ $ this ->l10n = $ l10n ;
2828 }
2929
3030 public function getFile (Folder $ folder ): ?File {
3131 foreach ($ this ->getSupportedFilenames () as $ filename ) {
3232 try {
33- $ file = $ folder ->get ($ filename );
34- if ($ file instanceof File) {
35- return $ file ;
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+ }
3639 }
37- } catch (NotFoundException |NotPermittedException | StorageInvalidException ) {
40+ } catch (NotFoundException |StorageInvalidException ) {
3841 continue ;
3942 }
4043 }
You can’t perform that action at this time.
0 commit comments