DAV Copy with wildcards

62 views
Skip to first unread message

proc

unread,
Nov 18, 2009, 2:37:31 PM11/18/09
to ControlTier
Hi ControlTier,

I am trying to use the DAV copy command to copy x number of files
(with the same extension, in this case *.aar) within a DAV directory
to a local directory.

I've been playing around for quite a while now, and have come up with:

ctl -z -p myProject -m davutil -c copy -- -src dav://deployment/aars -
dest /tempDir

The problem with this is that it executes correctly, but creates a
local FILE called tempDir, not a local directory. I have looked
through the reference guide for DAV copy but can't see an example or
reference for what I'm trying to do.

If this is not possible with DAV copy, is there an alternative way I
can do this?

Kind regards,

Michael

Moses Lei

unread,
Nov 18, 2009, 2:41:56 PM11/18/09
to contr...@googlegroups.com
I just file two bugs on davutil#copy yesterday! One of which is the problem you describe and the other is related.


So, in short, this is not the correct behavior and we should fix it... maybe a developer can weigh in on the cause of the bug.

Moses

--
Moses Lei
[ Professional Services | DTO Solutions, Inc. ]
[ mobile: 703.901.5969 | e-mail: ml...@dtosolutions.com | aim/gtalk: ml...@controltier.com | yahoo: moseslei ]




--
You received this message because you are subscribed to the Google Groups "ControlTier" group.
To post to this group, send email to contr...@googlegroups.com
To unsubscribe from this group, send email to controltier...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/controltier?hl=en
http://wiki.controltier.org

Alex-SF

unread,
Nov 18, 2009, 2:49:19 PM11/18/09
to ControlTier
I believe it should be possible to support this as the davutil modue
is based on WebDAV tasks: http://www.jdocs.com/extradocs/68/org.apache.webdav.ant/doc-files/tasks.htm

On Nov 18, 11:41 am, Moses Lei <m...@dtosolutions.com> wrote:
> I just file two bugs on davutil#copy yesterday! One of which is the problem
> you describe and the other is related.
>
> https://sourceforge.net/tracker/?func=detail&aid=2899524&group_id=151...https://sourceforge.net/tracker/?func=detail&aid=2899521&group_id=151...
>
> So, in short, this is not the correct behavior and we should fix it... maybe
> a developer can weigh in on the cause of the bug.
>
> Moses
>
> --
> Moses Lei
> [ Professional Services | DTO Solutions, Inc. ]
> [ mobile: 703.901.5969 | e-mail: m...@dtosolutions.com | aim/gtalk:
> m...@controltier.com | yahoo: moseslei ]

proc

unread,
Nov 18, 2009, 5:07:47 PM11/18/09
to ControlTier
So at the moment this means that it's not possible to do what I want
do to? Might have get grab a file list out of the folder and do it
that way...

On that, is there a clean text way of grabbing the list of services
deployed on a node through ctl? I can get a list, but when run through
ctl-exec the output is very padded and would need a huge amount of
parsing. Have I missed a nice way to do that?

Regards,

Michael

On Nov 18, 7:49 pm, Alex-SF <aho...@users.sourceforge.net> wrote:
> I believe it should be possible to support this as the davutil modue
> is based on WebDAV tasks:http://www.jdocs.com/extradocs/68/org.apache.webdav.ant/doc-files/tas...
>
> On Nov 18, 11:41 am, Moses Lei <m...@dtosolutions.com> wrote:
>
> > I just file two bugs on davutil#copy yesterday! One of which is the problem
> > you describe and the other is related.
>
> >https://sourceforge.net/tracker/?func=detail&aid=2899524&group_id=151......

Alex-SF

unread,
Nov 18, 2009, 5:20:44 PM11/18/09
to ControlTier
The deployments.properties (http://wiki.controltier.com/wiki/
Deployments.properties) might be what you are looking for that
describes what resources are installed on a CTL node.

Alex-SF

unread,
Nov 18, 2009, 9:13:07 PM11/18/09
to ControlTier
Hi Michael,

I looked into supporting this feature and found it pretty
straightforward. I updated the command definition for davutil#copy to
check if the -src argument ends with a trailing slash and if so treats
it like a WebDAV collection.

I also added a davutil#get command which contains just the
implementation for retrieving WebDAV resources and supports includes
filtering: https://sourceforge.net/tracker/?func=detail&atid=779850&aid=2900209&group_id=151079

I encourage you to try these and give feedback. It's easy to build a
module locally. Check out the davutil module source here:
http://moduleforge.svn.sourceforge.net/svnroot/moduleforge/controltier/branches/controltier-3-4-support/core/modules/davutil
Then run ProjectBuilder#build-type to build and load it to the server.

Here's the commands

$ cd $CTL_BASE/src
$ svn co http://moduleforge.svn.sourceforge.net/svnroot/moduleforge/controltier/branches/controltier-3-4-support/core/modules/davutil
modules/davutil
$ ctl -p demo -m ProjectBuilder -c build-type -- -type davutil -upload
-deploy

Once built and deployed, try copying a directory. Here's an example
that copies all the scripts ending in .sh:

$ ctl -p demo -m davutil -c get -- -url dav://examples/mock-unix-service/scripts/
-include '*.sh' -dest /tmp/scripts
$ ls /tmp/scripts/
isdown.sh

proc

unread,
Nov 19, 2009, 5:13:39 AM11/19/09
to ControlTier
Thank you very, very, very much Alex! Your 'get' command is the
perfect solution and operates exactly as expected. It means that I'll
be able to stick to my original design and implement things as
expected.

When you mention giving feedback, is there an official place you would
like me to do it in?

In regards to deployment.properties, I had looked into using that
before, and after comparing it to the output that I've been using I
will most probably use that.

Once again, many thanks and kind regards,

Michael

On Nov 19, 2:13 am, Alex-SF <aho...@users.sourceforge.net> wrote:
> Hi Michael,
>
> I looked into supporting this feature and found it pretty
> straightforward. I updated the command definition for davutil#copy to
> check if the -src argument ends with a trailing slash and if so treats
> it like a WebDAV collection.
>
> I also added a davutil#get command which contains just the
> implementation for retrieving WebDAV resources and supports includes
> filtering:https://sourceforge.net/tracker/?func=detail&atid=779850&aid=2900209&...
>
> I encourage you to try these and give feedback. It's easy to build a
> module locally. Check out the davutil module source here:http://moduleforge.svn.sourceforge.net/svnroot/moduleforge/controltie...
> Then run ProjectBuilder#build-type to build and load it to the server.
>
> Here's the commands
>
> $ cd $CTL_BASE/src
> $ svn cohttp://moduleforge.svn.sourceforge.net/svnroot/moduleforge/controltie...
> modules/davutil
> $ ctl -p demo -m ProjectBuilder -c build-type -- -type davutil -upload
> -deploy
>
> Once built and deployed, try copying a directory. Here's an example
> that copies all the scripts ending in .sh:
>
> $ ctl -p demo -m davutil -c get -- -url dav://examples/mock-unix-service/scripts/
> -include '*.sh' -dest /tmp/scripts
> $ ls /tmp/scripts/
> isdown.sh
>
> On Nov 18, 11:37 am, proc <backupisg...@gmail.com> wrote:
>
>
>
> > Hi ControlTier,
>
> > I am trying to use the DAV copy command to copy x number of files
> > (with the same extension, in this case *.aar) within a DAV directory
> > to a local directory.
>
> > I've been playing around for quite a while now, and have come up with:
>
> > ctl -z -p myProject -m davutil -c copy -- -src dav://deployment/aars -
> > dest /tempDir
>
> > The problem with this is that it executes correctly, but creates a
> > local FILE called tempDir, not a local directory. I have looked
> > through the reference guide for DAV copy but can't see an example or
> > reference for what I'm trying to do.
>
> > If this is not possible with DAV copy, is there an alternative way I
> > can do this?
>
> > Kind regards,
>
> > Michael- Hide quoted text -
>
> - Show quoted text -

proc

unread,
Nov 19, 2009, 7:06:24 AM11/19/09
to ControlTier
Hi again Alex,

I've done a bit more playing around with the new 'get' method and seem
to have discovered a bug. I've tested it on my Linux master box and
have been trying to get it to work on my Windows (using Cygwin) client
box.

Running the command:

ctl -p myProject -m davutil -c get -- -url dav://deployment/aars/ -
include '*.aar' -dest /tempcreate

Produces the correct output ("Downloaded 2 resources from <dav url>")
on both the Linux and Windows machines. On my Linux machine is creates
the folder and places the retrieved files inside. However, the files
are of size 0 bytes (they are not on the dav server). On the windows
machine the same 0 bytes file size error is present.

What also occurs is the files are placed following a strange
convention, or at least to my eyes i.e the above command creates a
directory in C:\Documents and Settings\userName\tempcreate. Using a
more clear example, if I were to use the dest dir "/cygdrive/c/
tempcreate" it would create a folder in C:\cygdrive\c\. I don't think
this is consistent with how other ctl commands use the cygdrive
directory (I have been using the convention /cygdrive/c/ctier... for
my Windows machine without problems and that performs operations on C:
\ctier as I would expect).

Please let me know what you think.

Regards,

Michael

Alex-SF

unread,
Nov 19, 2009, 2:20:33 PM11/19/09
to ControlTier
Hi Michael,
Let me give it a try on my Windows VM.

Alex-SF

unread,
Nov 19, 2009, 3:54:39 PM11/19/09
to ControlTier

I was able to reproduce this problem and have narrowed it down to a
bug in the org.apache.webdav.ant.taskdefs.Get class that comes from
the (now defunct) Jakarta Slide webdav library.
The webdav client code was resurrected as the "webdavclient4j" project
hosted on Sourceforge (http://sourceforge.net/projects/
webdavclient4j/). I am going to see if that implementation does not
have this bug.

proc

unread,
Nov 19, 2009, 4:16:04 PM11/19/09
to ControlTier
Thank you for the update Alex.

Regards,

Michael

Alex-SF

unread,
Nov 19, 2009, 6:29:06 PM11/19/09
to ControlTier
Not sure but I think there is a bug in davget task. I have posted a
question to the webdavclient4j forum:
http://sourceforge.net/projects/webdavclient4j/forums/forum/806778/topic/3464298

I'll keep a close eye on this one.

proc

unread,
Nov 20, 2009, 4:40:54 AM11/20/09
to ControlTier
Thanks Alex. I've bookmarked the webdavclient4j thread and will keep
an eye on it as well as this one for any updates. Guess I'll just have
to implement my clunky workaround for now :)

Regards,

Michael

On Nov 19, 11:29 pm, Alex-SF <aho...@users.sourceforge.net> wrote:
> Not sure but I think there is a bug in davget task. I have posted a
> question to the webdavclient4j forum:http://sourceforge.net/projects/webdavclient4j/forums/forum/806778/to...
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages