[opencms-dev] cmsObject.getFilesInFolder() return from cache.

Govind R rocks2984 at gmail.com
Fri Feb 20 08:47:09 CET 2009

Hello All.

I have a strange problem when i am using cmsObject.getFilesInFolder().

I have OpenCms Version 6.2.3 deployed in Jboss4.2.0GA

My Test Case:-

I have my MyBeanLoader as i using spring and opencms.

MyOperations myOperations = null;
public void testOpencms()
        myOperations = (MyOperations) MyBeanLoader.getInstance("MyOperations
            try {
              // Gets the  list of files from resource.

                Vector<CmsFile> documentsize = myOperations
                System.out.println("Document::"+documentsize .size());

                // Checks for the existence of resource.

                boolean checkExistsDocument = myOperations


                // Gets the document

                byte[] document = myOperations
                System.out.println("document ::"+document );
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block


MyOperations  is wrapper for CmsObject and the above api's
will call getFilesInFolder of CmsObject*,
*getDocument will call** ** readFile** of CmsObject,**existsDocument will
call existsResource **of CmsObject.
when i run the test case  i will not be having "*abc*" file in *"MyResource"
* folder.

So the output which i get

*Document::*" 0
*document *::null

After some execution i create "*abc*" file in *"MyResource"* folder from my
other appilication .

So the output which i get is

*Document::*" 0
*document *::@fgdfgdfh

i am not able to find why it gives 0 size. *i think may be its is returning
the size from cache*

But if i  do OpenCms.initCmsObject every time i get the proper count.Why???

Can u help me why.

Govind R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20090220/e591930d/attachment.html>

More information about the opencms-dev mailing list