Skip to content

Commit 89aa514

Browse files
committed
feat: add fileDaoName property to FSFileContentDAO for dynamic DAO retrieval
1 parent df68da2 commit 89aa514

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/foam/core/fs/FSFileContentDAO.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,21 @@ foam.CLASS({
2525
'java.nio.file.Path',
2626
'java.nio.file.Paths'
2727
],
28-
28+
properties: [
29+
{
30+
class: 'String',
31+
name: 'fileDaoName',
32+
value: 'FSFileDAO'
33+
}
34+
],
2935
methods: [
3036
{
3137
name: 'find_',
3238
javaCode: `
3339
var ret = getDelegate().find(id);
3440
if ( ret != null ) return ret;
3541
36-
FSFile file = (FSFile) ((DAO) x.get("FSFileDAO")).find((String) id);
42+
FSFile file = (FSFile) ((DAO) x.get(getFileDaoName())).find((String) id);
3743
if ( file == null ) {
3844
Loggers.logger(x, this).error("Error getting content: FSFile not found for id: ", (String) id);
3945
return null;

0 commit comments

Comments
 (0)