[opencms-dev] Alternative for getPath

Alexander Kandzior alex at opencms.org
Tue Jul 20 13:38:02 CEST 2004


Hi,
 
use 
org.opencms.file.CmsResource.getRootPath() 
 
to get the "full" root path. If you are working in a site, you need to
remove the site root. 
 
Here's some basic code to achive this:
 
CmsObject cms;
CmsResource res;
// make sure cms / res are initialized
 
String path = cms.getRequestContext().getSitePath(res);
 
or simpler:
 
String path = cms.getSitePath(res); // internally does the same
 
Please note that this is true for the current CVS and also for the
to-be-released future versions of OpenCms. Some earlier versions of 5.3.x
might have the naming of the methods different.
 



Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com <http://www.alkacon.com/>  

 
 
 

-----Original Message-----
From: opencms-dev-admin at opencms.org [mailto:opencms-dev-admin at opencms.org]
On Behalf Of Oliver Pereira
Sent: Tuesday, July 20, 2004 1:16 PM
To: opencms-dev at opencms.org
Subject: [opencms-dev] Alternative for getPath
Importance: High



Hi, 

What is the new alternative method for the getPath() method in 5.3.x?
(com.opencms.file.CmsFile.getPath and the opencms.file.CmsResource.getPath)

I am trying to import the application developed in 5.0.1 into 5.3.x 

Do you have any suggestions / hints in finding the required methods in
OpenCMS 5.3.x;. 

I am using eclipse to do the search 

Regards, 

Oliver 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040720/47e45f4b/attachment.htm>


More information about the opencms-dev mailing list