SmartFrog 3.10.000

org.smartfrog.sfcore.utils
Class PlatformHelper

java.lang.Object
  extended by org.smartfrog.sfcore.utils.PlatformHelper

public class PlatformHelper
extends java.lang.Object

Repository of file and path values for the local and different platforms. Future versions may do more; this design is there to permit subclasses to do the work. created 27-May-2004 11:41:31


Constructor Summary
protected PlatformHelper(java.lang.String fileSeparator, char fileSeparatorChar, java.lang.String pathSeparator, char pathSeparatorChar)
          construct a platform helper bound to a set of settings
 
Method Summary
 java.lang.String convertFilename(java.lang.String filename)
          convert the filename by happily converting all forward or back slashes into the appropriate one for the string.
 boolean equals(java.lang.Object that)
          equality test
static PlatformHelper getDosPlatform()
          get the DOS settings
 java.lang.String getFileSeparator()
          get the file separator
 char getFileSeparatorChar()
          get the file separator character
static PlatformHelper getLocalPlatform()
          create a platform helper which is bound to this system
 java.lang.String getPathSeparator()
          get the path separator character
 char getPathSeparatorChar()
          get the path separator character
static PlatformHelper getUnixPlatform()
          get the unix settings
 int hashCode()
          hash code is based on the file and path separators
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformHelper

protected PlatformHelper(java.lang.String fileSeparator,
                         char fileSeparatorChar,
                         java.lang.String pathSeparator,
                         char pathSeparatorChar)
construct a platform helper bound to a set of settings

Parameters:
fileSeparator - file separator
fileSeparatorChar - file separator character
pathSeparator - path separator
pathSeparatorChar - path separator character
Method Detail

getLocalPlatform

public static PlatformHelper getLocalPlatform()
create a platform helper which is bound to this system

Returns:
the local platform helper

getDosPlatform

public static PlatformHelper getDosPlatform()
get the DOS settings

Returns:
the DOS platform helper

getUnixPlatform

public static PlatformHelper getUnixPlatform()
get the unix settings

Returns:
the unix platform helper

convertFilename

public java.lang.String convertFilename(java.lang.String filename)
convert the filename by happily converting all forward or back slashes into the appropriate one for the string. Always creates a new string, even if if the original is unchanged.

Parameters:
filename - filename -can be null
Returns:
a converted filename or null if the input was null

getFileSeparator

public java.lang.String getFileSeparator()
get the file separator

Returns:
current file separator

getFileSeparatorChar

public char getFileSeparatorChar()
get the file separator character

Returns:
the file separator

getPathSeparator

public java.lang.String getPathSeparator()
get the path separator character

Returns:
the path separator

getPathSeparatorChar

public char getPathSeparatorChar()
get the path separator character

Returns:
the path separator

equals

public boolean equals(java.lang.Object that)
equality test

Overrides:
equals in class java.lang.Object
Parameters:
that - the object to test against
Returns:
true iff there is match

hashCode

public int hashCode()
hash code is based on the file and path separators

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP