nice post dude very useful look I want to make button "full scan" to start scanning the hard drive but I can easly set a name of the path but what happens if the path is alike as the one that I set for example in linux the path is "root" and in windows the path is "C or D" however they are named I will have to read the user`s path name? or I need to use a thing named getdefault directory? for example:
...
this one looks smart I think that Im going to implement that one
No matter what, you will have implement different engine for linux/windows. Java may be cross-compatible, but binary files are not. Filesystem architecture is not. There are also many, many more differences between the two.
Use [System.getProperty("os.name")] to identify system. Use [System.getenv()] to find folders, for windows these environment variables should be targeted:
System.getenv("ProgramFiles") // Program files directory(C:\Program Files)
System.getenv("SystemRoot") // Windows System Root(C:\Windows)
System.getenv("UserProfile") // HOME Directory
System.getenv("SystemDrive") // Windows Drive(C:) - don't re-scan drives already scanned
Each should have own GUI option, perhaps in groups. Like a "user scan" option, HOME & Program Files. A system scan, C:\Windows & perhaps registry. Option of scanning any full drive(use example xor provided, [File.listRoots()]). Any more options you can think of.
In linux, no need for such things. Linux mounts drives using /etc/fstab, so no matter what... your root drive is "/". chroot will change this(will be "/" nontheless).
"/lib"
"/sbin"
"/usr/bin"
"/usr/local/bin"
"/bin"
System.getenv("HOME") // if rooted, then use "/home" instead
"/" // don't re-scan drives already scanned
In linux you will get a list of the partitions made on the disk and their mount points
If this is correct(untested, have no linux except android at the moment), then my box would show a partition for /, /boot, /home(gentoo). Would also have a swap partition. Would also have many usb drives(which would be worth option searching). This may cause problems, unless by partitions xor means actual "root drives", like your linux filesystem + any extra external/internal drive mounted in /mnt.