Liferay: how to delete uploaded files in liferay document library folder programmatically? -
i need help. know how clear uploaded files data/document_library folder. example develop foto upload portlet. , when user upload new foto, previous should deleted. here example of abs example image url. http://localhost:8080/image/journal/article?img_id=30634
how can programatically remove files mapped such urls?
update
after analyzing liferay database tables (image , etc.) have come desicion:
if (stringutils.isnotempty(portraiturl)) { pattern pattern = pattern.compile("([0-9]+)$"); matcher matcher = pattern.matcher(portraiturl); if (matcher.find()) { imagelocalserviceutil.deleteimage(long.valueof(matcher.group(0))); } }
regex search image id in portrait url http://localhost:8080/image/journal/article?img_id=30634
Comments
Post a Comment