Message Boards

Best way to delete file entries in Liferay 6.2

Sam Collett, modified 4 Years ago.

Best way to delete file entries in Liferay 6.2

New Member Posts: 20 Join Date: 11/11/19 Recent Posts
I have tried a few methods to delete a file entry in Liferay 6.2, since the file does not exist on disk and I want to tidy up the database. I have tried a few methods, they all remove the entry from the dlfileentry table, but none of the related ones, like dlfileentrymetadata. Looking at the code, it should work, but it doesn't seem to. Am I missing a step? The methods I have tried:

DLAppServiceUtil.deleteFileEntry(1234)
---
DLFileEntryLocalServiceUtil.deleteFileEntry(1234)
---
DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(1234)
FileEntry fileEntry = new LiferayFileEntry(dlFileEntry)
DLAppHelperLocalServiceUtil.deleteFileEntry(fileEntry)

These were all done via the script console through the portal itself.