To all FS developpers: need for Abstract

I really think we need an AbstractFileSystem that implements (partially) FileSystem implementation. All the FileSystem will inherit from AbstractFileSystem.
In this abstract class, I will put :

that's the new functionality I will add :
- a readOnly property (getter/setter)

this is common to all FileSystem implementations
- a Device member variable
- a BlockDeviceAPI member variable

Do you think I should add other things (first sector ?) ?

FS options

Readonly/readwrite will probably not be the only option that a FS implementation might need (e.g. username and password with smbfs, etc), so why not make it more generic and add someting like a setOption(Properties prop) method to FileSystem interface? And when mounting the partition, fill the properties with the option names as keys and option values as values to it.
(btw what is the advantage of adding these methods to an abstract class over adding them to the existing FileSystem interface?)
Andras

we need abstract things

We need this abstract class..we duplicate the code like hell. We should also have an abstract class for FSEntry , FSFile and FSDirectory. For example in FSDirectory there is a method called getEntry(String name) which can be implemented and it is implemented using the iterator from the same class. why should we allways duplicate this method around? I think we need an abstract for all even if it is empty. it is easyer to add it first than later.

creationTime and lastAccessed for all FileSystems ?

As I am working on AbstractFSEntry, I realize that there is creationTime and lastAccessed attributes in LfnEntry (I guess it's only for FAT32).

And, in other FileSystems, is there anything similar ?
If not in all FileSystems, what about giving a default value (same as lastModified or new Date(0)) ?

What do you think ?

fs attributes

Hi Fabien,
These attributes are supported by the ext2 filesystem itself. I wanted to update Ext2Entry to add support for these under JNode but right now what's inside CVS doesn't build for me, I get an exception at bootdisk building:
[bootdisk] org.jnode.fs.FileSystemException: Device is not a partition!
[bootdisk] at org.jnode.fs.AbstractFileSystem.(AbstractFileSystem.java:31)
...
Looks like it is related to the AbstractFileSystem, maybe you could have a look at it.
Andras

Build fails!

I get the same error when trying to build as Andras.

Build works again

The build works again, as a message to all: please test before a commit.
Ewout

more details

Could you give more details
- eclipse ou line command ?
- which target ?

I got the same error while trying to run under eclipse/windows Ext2Test or FatTest I don't remember which. Valentin said me these tests works under JNode but haven't been tested outside for a long time.

abstraction in FileSystem classes

Do you know this urlhttp://www.nongnu.org/ext2-doc/ext2.html#IFDIR
There is some doc about ext2. I don't know if it could help you.

Currently, I am creating abstract class :
- AbstractFileSystem : committed in CVS, please update JNode-FS and JNode-Build
- AbstractFSFile : nearly finished, relatively easy
- AbstractFSDirectory : I'm currently working on it, it difficult.
- AbstractFSEntry : seems the most harder to do

ext2 docs

Hi Fabien,
Thanks a lot for the link, actually I have used this document a lot. Probably it's the most accurate, but there is a lot of stuff that's not covered in any documentation I have found (except for the linux implementation itself). So I made great use of e2fsck, ext2ed and dumpe2fs as well Smiling
The indexed directory support is still in the pipe :]
Andras