You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stéphane Rault <ks...@yahoo.fr> on 2005/01/20 12:22:56 UTC
sandbox VFS
Hello,
I'm trying to use the wonderful VFS. It works quite well but I've a
problem with writing in zip file. Searching for informations, I wonder
if VFS is still a live project and if sometimes, it will leave the
sandbox to become a complete Jakarta-Common project ? I want to use it
in a professionnal application and I need to be sure the project goes on
(I can't really maintain all that code alone but I can help if necessary).
Thanks for your response...
Stéphane.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[vfs] file locking
Posted by Mario Ivankovits <ma...@ops.co.at>.
filipdef@cirquedigital.com wrote:
>PS: any specs for what you'd like to do file locking wise?
>It's one of the things I need next, so maybe I can help?
>
I would like to see what [transaction]
http://jakarta.apache.org/commons/transaction/ do and if this could be
used for this purpose.
A first look at it seems promising.
If possible the lock should be passed to the real filesystem too.
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] sandbox VFS
Posted by fi...@cirquedigital.com.
> You are right, I too think its time to discuss a plan how to migrate it
> to commons proper - I planed to poll for it in a couple of months. Not
> sure what the community thinks about it.
Hi -- I use it as a crucial piece of one of my projects
and it's behaving beautifully.. I'm all for moving
it to commons proper..
Cheers,
- Filip
PS: any specs for what you'd like to do file locking wise?
It's one of the things I need next, so maybe I can help?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] sandbox VFS
Posted by Stéphane Rault <ks...@yahoo.fr>.
Mario Ivankovits wrote:
> Well, VFS is alive in a manner that I try to fix major problems and
> reported bugs.
>
>
> I decided to go in small steps as I use it in our project as
> java.io.File replacement (where possible) and thus have to ensure its
> stability. Currently I feel very comfortable about its stability.
>
> As soon as I have more time I would like to implement something like
> file-locking.
Yes, and the NFS support would be interesting too.. I saw it in the TO
DO List.
>
>
> You are right, I too think its time to discuss a plan how to migrate
> it to commons proper - I planed to poll for it in a couple of months.
> Not sure what the community thinks about it.
Sure that it would be a good idea. !!
So, for now, I decided to keep it in my project but in a secure way (I
encapsulate it in a single class to change it more easily.)
In some weeks, I will be more free time and I will spend some time
reading the sources.
Thanks for answering...
Stéphane.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] sandbox VFS
Posted by Mario Ivankovits <ma...@ops.co.at>.
Stéphane Rault wrote:
> I'm trying to use the wonderful VFS. It works quite well but I've a
> problem with writing in zip file. Searching for informations, I wonder
> if VFS is still a live project and if sometimes, it will leave the
> sandbox to become a complete Jakarta-Common project ? I want to use it
> in a professionnal application and I need to be sure the project goes
> on (I can't really maintain all that code alone but I can help if
> necessary).
Well, VFS is alive in a manner that I try to fix major problems and
reported bugs.
I decided to go in small steps as I use it in our project as
java.io.File replacement (where possible) and thus have to ensure its
stability. Currently I feel very comfortable about its stability.
As soon as I have more time I would like to implement something like
file-locking.
You are right, I too think its time to discuss a plan how to migrate it
to commons proper - I planed to poll for it in a couple of months. Not
sure what the community thinks about it.
---
Mario
Re: [vfs] more FileUtils
Posted by Mario Ivankovits <ma...@ops.co.at>.
Brian Oxley wrote:
> Mario Ivankovits wrote:
>> ... this "MaybeBackup" is a thing we could discuss at its own.
>> How should a backup be done and named?
>> a) backup to *.bak
>> b) use versioning - e.g. *.bak_01, *.bak_02
>> b.1) with max versions
>> c) use timestamping - e.g. *.bak_20050101
>> c.1) but not more than 20 backups
>
> Just an example. What I did was give the WhimFile instance methods to
> cover these cases so that extending classes could implement their own
> policy. I didn't intend to clutter my example with these issues! I
> should be more careful.
No No - my fault, I tend to be a little bit rush if it comes to new
functions and then such "details" comes into my mind "too early".
> Is there a format I should follow in writing said proposal?
I think it is sufficient if you just write it into a mail.
Method(args, ...)
Description
Method(args, ...)
Description
... and so on.
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] more FileUtils
Posted by Brian Oxley <bo...@simdesk.com>.
Mario Ivankovits wrote:
> ... this "MaybeBackup" is a thing we could discuss at its own.
> How should a backup be done and named?
> a) backup to *.bak
> b) use versioning - e.g. *.bak_01, *.bak_02
> b.1) with max versions
> c) use timestamping - e.g. *.bak_20050101
> c.1) but not more than 20 backups
Just an example. What I did was give the WhimFile instance methods to
cover these cases so that extending classes could implement their own
policy. I didn't intend to clutter my example with these issues! I
should be more careful.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[vfs] more FileUtils
Posted by Mario Ivankovits <ma...@ops.co.at>.
B. K. Oxley (binkley) wrote:
> I'd like to see some more utility methods for manipulating file
> objects. For example, much of my code needs:
>
> void saveAs() throws IOException;
> void moveTo() throws IOException;
> void copyTo() throws IOException;
For sure, we could introduce a FileUtils, but ...
> private static void saveMaybeBackup(final WhimFile original,
... this "MaybeBackup" is a thing we could discuss at its own.
How should a backup be done and named?
a) backup to *.bak
b) use versioning - e.g. *.bak_01, *.bak_02
b.1) with max versions
c) use timestamping - e.g. *.bak_20050101
c.1) but not more than 20 backups
and so on.
Said that, I think, if such a method allows a "BackupPolicy" and we
provide SimpleBackupPolicy (case a) and NoBackupPolicy this could be a
real enhancement.
Could you please post a proposal about the methods and its functions you
would like to see. This would be a great start.
Thanks!
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: sandbox VFS
Posted by "B. K. Oxley (binkley)" <bi...@alumni.rice.edu>.
Stéphane Rault wrote:
> I'm trying to use the wonderful VFS. It works quite well but I've a
> problem with writing in zip file. Searching for informations, I wonder
> if VFS is still a live project and if sometimes, it will leave the
> sandbox to become a complete Jakarta-Common project ?
I'd like to see some more utility methods for manipulating file objects.
For example, much of my code needs:
void saveAs() throws IOException;
void moveTo() throws IOException;
void copyTo() throws IOException;
I use these as high-level operations which use do-or-die semantics
(succeed or throw an exception) and call more basic file object
operations to do the work. Here is the implementation of saveAs() with
a lot of things unexplained (but I use readable names, so I hope that
helps -- a WhimFile is just a java.io.File with these extra operations;
I'm using it to demonstrate my ideas to my coworkers):
private static void saveMaybeBackup(final WhimFile original,
final InputStream newContents, final boolean keepBackup)
throws IOException {
final WhimFile scratch = original.createTempWhimFile("save", null);
try {
copyAndClose(newContents, scratch.getOutputStream());
if (keepBackup && original.exists())
original.moveToWithOverwrite(original.createBackupFile());
// TODO: if scratch.moveTo throws, restore original from backup?
scratch.moveToWithOverwrite(original);
} finally {
scratch.delete();
}
}
Cheers,
--binkley
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org