<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
There are times in my life that I have never been happier to feel like
an idiot.  Your fresh perspective helped me go back and quadruple check
the destination portion of the copy process.  I found that I had been
glossing over the ever-so-difficult-to-see-with-my-eyesight space in
the path.  ARRRRG!<br>
<br>
Now works perfectly.<br>
<br>
Thank you very much for your help and encouragement.  <br>
<br>
Jonathan Woods wrote:
<blockquote cite="mid050b01c6d8f9$4edd4c60$0500a8c0@COMPUTER2"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.2900.2963" name="GENERATOR">
  <div dir="ltr" align="left"><span class="023355418-15092006"><font
 color="#0000ff" face="Arial" size="2">I can't think of a reason why
xmpages and images would be treated differently.  But maybe there's
some other difference: is there a difference in the CmsResourceFilter
used under the hood by readResource etc and copyResource?  Maybe the
resource in question is deleted, expired etc in one case but not in the
other.</font></span></div>
  <div dir="ltr" align="left"><span class="023355418-15092006"></span> </div>
  <div dir="ltr" align="left"><span class="023355418-15092006"><font
 color="#0000ff" face="Arial" size="2">It's odd that your error message
when calling ...copyResource() says "error CREATING <some path>"
- it's not saying that it can't find the source resource, but that it
can't create one.    That makes reminds me of the kind of error
messages you get in various environments when trying to create a
resource in a folder which itself doesn't exist - but I don't see how
that can be the case.</font></span></div>
  <div dir="ltr" align="left"><span class="023355418-15092006"></span> </div>
  <div dir="ltr" align="left"><span class="023355418-15092006"><font
 color="#0000ff" face="Arial" size="2">Jon</font></span></div>
  <div dir="ltr" align="left"><span class="023355418-15092006"></span> </div>
  <div dir="ltr" align="left">
  <hr tabindex="-1"></div>
  <div dir="ltr" align="left"><font face="Tahoma" size="2"><b>From:</b>
<a class="moz-txt-link-abbreviated" href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext" href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] <b>On Behalf Of </b>Daniel
Rhoden<br>
  <b>Sent:</b> 15 September 2006 19:40<br>
  <b>To:</b> The OpenCms mailing list<br>
  <b>Subject:</b> Re: [opencms-dev] Tell me if this makes sense...<br>
  </font><br>
  </div>
Thanks Jon.<br>
  <br>
Sorry for forgetting to state the fact that I am executing this jsp
from within the Root site ( / ) and not a site itself.<br>
  <br>
But you are correct that I would have to have the source =
"/myImage.jpg" if I were in the "mySite" site.  I would assume if the
ob.existsResource() method see the file (returns true) then the
copyResource should see it just as well (my assumption).<br>
  <br>
What is odd is how I have used my generic copy-a-resource.jsp to copy
other resources and they worked just fine.  I haven't been able to
identify the differences between the circumstances of when it worked
and now.  Would the fact that I am copying an image and not an xmlpage
be the problem?<br>
  <br>
Jonathan Woods wrote:
  <blockquote cite="mid04f901c6d8f4$2933fa90$0500a8c0@COMPUTER2"
 type="cite">
    <meta content="MSHTML 6.00.2900.2963" name="GENERATOR">
    <div dir="ltr" align="left"><span class="409162118-15092006"><font
 color="#0000ff" face="Arial" size="2">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.</font></span></div>
    <div dir="ltr" align="left"><span class="409162118-15092006"></span> </div>
    <div dir="ltr" align="left"><span class="409162118-15092006"><font
 color="#0000ff" face="Arial" size="2">Jon</font></span></div>
    <br>
    <div class="OutlookMessageHeader" dir="ltr" align="left"
 lang="en-us">
    <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> <a
 class="moz-txt-link-abbreviated"
 href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext"
 href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>]
    <b>On Behalf Of </b>Daniel Rhoden<br>
    <b>Sent:</b> 15 September 2006 19:11<br>
    <b>To:</b> The OpenCms mailing list<br>
    <b>Subject:</b> [opencms-dev] Tell me if this makes sense...<br>
    </font><br>
    </div>
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: <br>
(assume ob is an instance of CmsObject and <b>source</b> =
"/sites/mySite/myImage.jpg") <br>
    <ol>
      <li>When I do ob.existsResource(<b>source</b>) it returns true.  <br>
      </li>
      <li>I can even CmsResource rec = ob.readResource(<b>source</b>),
and <b>source</b>.equals(rec.getRootPath() ).  <br>
      </li>
      <li>Looks good, right? </li>
    </ol>
But when I try to ob.copyResource(<b>source</b>, destination), I get
the following exception:<br>
    <br>
org.opencms.file.<b>CmsVfsResourceNotFoundException</b>: Error creating
the resource "/sites/mySite/myImage.jpg"<br>
    <br>
Not Found???  Not Found??  Then what the heck was it doing with those
previous calls??<tt><br>
    <br>
    </tt>My installed OpenCms version is: 6.2.0<br>
    <span class="small">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)<br>
MySql<br>
    <br>
    <br>
    </span><br>
    <br>
    <pre wrap=""><hr size="4" width="90%">

_______________________________________________
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
<a class="moz-txt-link-freetext"
 href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></pre>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">

_______________________________________________
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
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></pre>
</blockquote>
</body>
</html>