Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Best way to delete file entries in Liferay 6.2
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.
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.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™