New Creator

File class error

Greetings everyone,


I'm having trouble running a method from a File class getLastChanged() in the documentation it states that the method is not deprecated but when I try to run this method via the BeanShell script I get the exception "Target exception: java.lang.UnsupportedOperationException: de.espirit.firstspirit.store.access.mediastore.FileImpl.getLastChanged()". So my question is am I doing something wrong or the method is not supported any more. My FirstSpirit version is 2023.6 .



long timestamp = file.getLastChanged();


This is how I called the method from the object of File class. 

0 Kudos
1 Reply
Crownpeak employee

The method is only supported for StoreElement objects that also implement the interface IDProvider.

0 Kudos