info.informatica.io
Class FilesystemInfo

java.lang.Object
  extended by info.informatica.io.FilesystemInfo
Direct Known Subclasses:
UnixFilesystemInfo

public class FilesystemInfo
extends Object

Encapsulates a few useful filesystem properties, and utility methods.

It uses a few configuration parameters, which can be set by subclasses:

Author:
amengual at informatica dot info

Nested Class Summary
 class FilesystemInfo.TokenizedPath
          Contains a tokenized path.
 
Constructor Summary
FilesystemInfo()
          Default Constructor.
 
Method Summary
static File createFileInDir(String fich)
          Given a file path, returns the corresponding file object.
 String getQualifiedPath(String disk_prefix, String path)
          Gets the qualified form of the given path.
 FilesystemInfo.TokenizedPath getTokenizedPath(String path)
           
 String getVolumePath(String volume, String qpath)
           
 boolean isCaseSensitive()
          Is this filesystem case sensitive?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesystemInfo

public FilesystemInfo()
Default Constructor.

Tries to guess the internal properties as for an Unix/Windows system.

Method Detail

getQualifiedPath

public String getQualifiedPath(String disk_prefix,
                               String path)
Gets the qualified form of the given path.

Parameters:
path - The unqualified path
Returns:
the same path, qualified with disk label and disk separator if applicable

getVolumePath

public String getVolumePath(String volume,
                            String qpath)
Parameters:
qpath - Path qualified with disk drive letter
Returns:
the path, not qualified with disk unit, or null if the path is not in the same volume (disk unit) as the qpath spec.

isCaseSensitive

public boolean isCaseSensitive()
Is this filesystem case sensitive?

Returns:
true if the filesystem is case sensitive, false if not.

getTokenizedPath

public FilesystemInfo.TokenizedPath getTokenizedPath(String path)

createFileInDir

public static File createFileInDir(String fich)
                            throws IOException
Given a file path, returns the corresponding file object. If any directories in the path do not exist, these are created.

Parameters:
fich - the path
Returns:
the File object
Throws:
IOException