[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Javahl mkdir use

From: Gonzalez Diaz, Xoan <G2485_at_caixagalicia.es>
Date: 2007-11-12 16:49:04 CET

Thanks Mark,

That was my idea. Your code is just what I needed. :)
Now, I only have to know how to determine in javahl if a directory
exists. Perhaps with DirEntry or Info class ...

If someone have some experience that wants to share ...

> -----Mensaje original-----
> De: Mark Phippard [mailto:markphip@gmail.com]
> Enviado el: lunes, 12 de noviembre de 2007 16:37
> Para: Gonzalez Diaz, Xoan
> CC: users@subversion.tigris.org
> Asunto: Re: Javahl mkdir use
>
> On 11/12/07, Gonzalez Diaz, Xoan <G2485@caixagalicia.es> wrote:
> >
> >
> >
> >
> > I'm trying to integrate Subversion with the project management
software
> of one of our clients.
> >
> > One of the actions to implement is to create a template of
directories
> inside the repository, with a predefined layout (to all new projects).
> This is done when a project begins.
> >
> > So, I am using mkdir (SVNClient, javahl). If I try to create a given
> directory, with parent directories that don't exist, an exception is
> thrown. I guess this is normal behaviour of function.
> >
> > But browsing the trunk I noticed that is being implemented the
> complementary behaviour: create automatically all parent directories.
> >
> >
> >
> > Until 1.5 arrives I have to implement this behaviour by hand.
> >
> >
> >
> > Given a list of paths, for example:
> >
> > Trunk/App1/countrycode/organization/app/module
> >
> > Trunk/doc/countrycode/organization/app/module
> >
> > Trunk/dist/jars
> >
> >
> >
> > I would have to create :
> >
> > -Trunk
> >
> > -Trunk/App1
> >
> > -Trunk/App1/countrycode
> >
> > -Trunk/App1/countrycode/organization
> >
> >
> >
> > ...and so on
> >
> >
> >
> > Is there another way more optimal than checking if a directory
exists
> and create if not?
> >
> > If there is not such way, how can I ask if a directory exists in the
> repository (especifying an url)?
>
> We had a similar need in Subclipse. This is how we implemented it in
> svnClientAdapter library:
>
> public void mkdir(SVNUrl url, boolean makeParents, String message)
> throws SVNClientException {
> if (makeParents) {
> SVNUrl parent = url.getParent();
> if (parent != null) {
> ISVNInfo info = null;
> try {
> info = this.getInfo(parent);
> } catch (SVNClientException e) {
> }
> if (info == null)
> this.mkdir(parent, makeParents, message);
> }
> }
> this.mkdir(url, message);
> }
>
> The svnClientAdapter code is just slightly different from JavaHL so it
> should be easy enough to convert the idea being used.
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Nov 12 16:49:05 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.