|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccs.utils.DriveLister
public class DriveLister
A problem with win32 is that multiple drives may or may not be present - any of A: to Z: and even a few more comedians as well (although these are not supported). UNIX variants use a unified filestore, so the only "drive" is root, "/".
This class was here to work around a bug in java.io.File.listRoots() which made it unusable on Win32. However, this bug has since been fixed (sort of) so it is no longer really necessary for that purpose. Hoewever, it has also acquired some utility methods, and there's no percentage in trying to kill it; this sort of buffer functionality is well within the traditions of ccs.utils.
Constructor Summary | |
---|---|
DriveLister()
|
Method Summary | |
---|---|
static boolean |
isWindows()
Whether this machine is running Windows. |
static java.lang.String[] |
listDriveIDs(java.io.File[] roots)
Returns a list of unique IDs for the supplied drives; these are URL-friendly and don't contain any punctuation which might confuse the parser. |
static java.io.File[] |
listDrives()
Returns a list of the available root directories. |
static java.lang.String[] |
listDrivesPrintably(java.io.File[] roots)
Returns a list of drive names, in an output-friendly format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DriveLister()
Method Detail |
---|
public static java.io.File[] listDrives()
public static java.lang.String[] listDrivesPrintably(java.io.File[] roots)
roots
- A list of available drives, obtained by a previous call to
listDrives.
public static java.lang.String[] listDriveIDs(java.io.File[] roots)
roots
- A list of available drives, obtained by a previous call to
listDrives.
public static boolean isWindows()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |