[opencms-dev] Opencms-Contents Auto Archiving

Navaneetha krishnan knavane at yahoo.co.in
Sat Oct 8 09:27:59 CEST 2005


Hi all,

      I am now trying to archive the files present under "sites/default" folder based on last date modified of each files. 

I m using the opencms 6.0.0 latest version.
For that, I used getResourcesInTimeRange(String foldername, long starttime, long endtime) from the CmsObject class.

My code snippets is as follows:
 
 java.util.List list= cmsObj.getResourcesInTimeRange("org.mysite.home/elements/announcements/history", longStartTime, longEndTime);
 java.util.Iterator i = list.iterator();
 
 while(i.hasNext())
 {
  org.opencms.file.CmsFile cmsFile= (CmsFile)i.next();
  byte[] bytContent = cmsFile.getContents();
  String strContent = new String(bytContent);
   
  out.print(strContent);
 }
 
When I run the above code, it returned me empty string instead of showing list of contents.

Can anyone please help me to comeout this issue.
 
Thanks in advance,

Navaneethan.


		
---------------------------------
 Yahoo! India Matrimony: Find your partner now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20051008/69ab528f/attachment.htm>


More information about the opencms-dev mailing list