You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "David J. M. Karlsen" <da...@davidkarlsen.com> on 2007/08/23 14:29:59 UTC

[transaction] move resource deletes the directory as well

Hi list!

I'm using

fileResourceManager.moveResource( txId,
                                                           inFilename,
                                                           outFilename,
                                                           false );


to move inFile to another directory as outfile

( eg in/filename.txt to out/filename.txt) under the same storeDir.

The file is moved - but what puzzles me is that the directory "in" is 
removed.

the file is correctly moved from in/filename.txt to out/filename.txt as it 
should.

Bug?

BTW: If I leave another file in the "in" directory the dir is not removed.



David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [transaction] move resource deletes the directory as well

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Hi David!

2007/8/23, David J. M. Karlsen <da...@davidkarlsen.com>:
> I'm using
>
> fileResourceManager.moveResource( txId,
>                                                            inFilename,
>                                                            outFilename,
>                                                            false );
>
>
> to move inFile to another directory as outfile
>
> ( eg in/filename.txt to out/filename.txt) under the same storeDir.
>
> The file is moved - but what puzzles me is that the directory "in" is
> removed.

In the 1.x version only file resources are managed, directories are
not. So if a directory happens to be empty it will be deleted
(comparable to CVS).

In the upcoming 2.0 version (expect a first beta to be out soon)
directories are also handled programmatically. Thus the issue you
describe should disappear in 2.0. You can have instant access to the
2.0 snapshot from SVN even now. Have a look at the site how to do
that.

HTH

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org