Skip to content
Snippets Groups Projects

ENH: Add functions for File entities

Merged Florian Spreckelsen requested to merge f-file-entity into dev
All threads resolved!
Files
3
+ 12
0
@@ -53,6 +53,14 @@ export class Entity {
@@ -53,6 +53,14 @@ export class Entity {
return this.wrappedEntity.getDescription();
return this.wrappedEntity.getDescription();
}
}
 
getFilePath() {
 
if (!this.isFile()) {
 
throw `Only FILE entities can have a file path.`;
 
}
 
const fileDescriptor = this.wrappedEntity.getFileDescriptor();
 
return fileDescriptor.getPath();
 
}
 
getId() {
getId() {
return this.wrappedEntity.getId();
return this.wrappedEntity.getId();
}
}
@@ -90,4 +98,8 @@ export class Entity {
@@ -90,4 +98,8 @@ export class Entity {
isRecord() {
isRecord() {
return this.wrappedEntity.getRole() === api.v1.EntityRole.ENTITY_ROLE_RECORD;
return this.wrappedEntity.getRole() === api.v1.EntityRole.ENTITY_ROLE_RECORD;
}
}
 
 
isFile() {
 
return this.wrappedEntity.getRole() === api.v1.EntityRole.ENTITY_ROLE_FILE;
 
}
}
}
Loading