[opencms-dev] Tell me if this makes sense...
Jonathan Woods
jonathan.woods at scintillance.com
Fri Sep 15 20:24:15 CEST 2006
The API is sometimes a bit inconsistent about the meaning of 'resource name'
or 'resource path' in method signatures: sometimes it's relative to the site
root, and sometimes it's absolute. Are you sure you are using the right
variant for CmsObject.copyResource()? I've not used the method, but I
imagine it takes a site-root-relative value.. yet your symbol 'source' is
absolute. Try using the relative equivalent and see if that helps.
Jon
_____
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Daniel Rhoden
Sent: 15 September 2006 19:11
To: The OpenCms mailing list
Subject: [opencms-dev] Tell me if this makes sense...
I am trying to copy a large number of files by writing a jsp that uses
CmsObject.copyResource(). Now tell me if this makes sense to you:
(assume ob is an instance of CmsObject and source =
"/sites/mySite/myImage.jpg")
1. When I do ob.existsResource(source) it returns true.
2. I can even CmsResource rec = ob.readResource(source), and
source.equals(rec.getRootPath() ).
3. Looks good, right?
But when I try to ob.copyResource(source, destination), I get the following
exception:
org.opencms.file.CmsVfsResourceNotFoundException: Error creating the
resource "/sites/mySite/myImage.jpg"
Not Found??? Not Found?? Then what the heck was it doing with those
previous calls??
My installed OpenCms version is: 6.2.0
Running on Sun Microsystems Inc. Java HotSpot(TM) Client VM 1.5.0_07-b03
mixed mode, sharing with Linux 2.6.9-34.EL (i386)
MySql
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060915/d4ae3ca5/attachment.htm>
More information about the opencms-dev
mailing list