[opencms-dev] count files in vfs folder

Paul-Inge Flakstad flakstad at npolar.no
Tue Nov 10 14:51:07 CET 2009


Hi Lorentz

org.opencms.file.CmsObject#getFilesInFolder(String resourcename) 
and
org.opencms.file.CmsObject#getFilesInFolder(String resourcename, CmsResourceFilter filter) 

both provide a solution to your challenge, I should imagine.

In a .jsp file, you can get an initialized CmsObject instance like this:
<%
org.opencms.jsp.CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
org.opencms.file.CmsObject cmso = cms.getCmsObject();
%>

Cheers,
Paul

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of 
> Lammersdorf, Lorenz
> Sent: 10. november 2009 13:46
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] count files in vfs folder
> 
> hi all,
> 
> i need to count files in a specific subfolder and to read 
> their filenames. the folder is an extended folder (download 
> gallery) and contains no xml-files, so contentload will not 
> work. the folder is not exported to the real filesystem. is 
> there a way to access the files? i don't like the idea of 
> exporting that folder very much.
> 
> thanks!
> lorenz
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 


More information about the opencms-dev mailing list