com.starbase.util
Class Platform

java.lang.Object
  |
  +--com.starbase.util.Platform

public class Platform
extends java.lang.Object

The Platform class is where I collect all platform specific APIs for things like end-of-line character and file lastModified methods... At some point, parts of this may need to be implemented in native code


Field Summary
static java.lang.String ONWINDOWSPROP
          You can set this system property on (any value will do) if you want to force the Platform class to use Win32 access to file properties and ConnectionManager.ini file.
 
Constructor Summary
Platform()
          Deprecated.  
 
Method Summary
static boolean caseSensitiveFileNames()
          Returns true if file names are case sensitive.
static java.lang.String getEOL()
          Return the end of line convention.
static boolean getFileExecutable(java.io.File file)
           
static double getFileLastModified(java.io.File file)
          returns the last modified time for the given file via a native platform call
static double getFileLastModified(java.lang.String fileName)
          returns the last modified time for the given file via a native platform call
static java.lang.String getFilePathDelim()
          Return file name path delimiter.
static boolean getFileWritable(java.io.File file)
           
static java.lang.String getHostAddress()
          Return this machine's host IP Address
static long getLastModified(java.io.File file)
          returns the last modified time for the given file via a native platform call
static long getLastModified(java.lang.String fileName)
          returns the last modified time for the given file via a native platform call
static java.lang.String getMachineName()
          Return this machine's name
static java.lang.String getOSName()
          Gets a descriptive name for the operating system.
static java.lang.String getSetReadOnlyCmd()
           
static java.lang.String getSetWritableCmd()
           
static java.lang.String getTouchCmd()
           
static GUID getWorkStationID()
           
static WorkStationOptions getWSOptions()
           
static boolean isDotNET()
          Determines whether or not we are running in a .NET environment.
static boolean isWin32()
          Determines whether or not we are running on a Win32 computer.
static void printProps()
           
static void setFileExecutable(java.io.File file, boolean executable)
           
static void setFileLastModified(java.io.File file, double oletime)
           
static void setFileWritable(java.io.File file, boolean val)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONWINDOWSPROP

public static final java.lang.String ONWINDOWSPROP
You can set this system property on (any value will do) if you want to force the Platform class to use Win32 access to file properties and ConnectionManager.ini file.

See Also:
Constant Field Values
Constructor Detail

Platform

public Platform()
Deprecated.  

Method Detail

isWin32

public static boolean isWin32()
Determines whether or not we are running on a Win32 computer. Currently, this is determined from the operating system name. To force the SDK to use Win32 behaviors, set the "onwin32" system property (e.g., -Donwin32=y).

Returns:
true if running under Win32.

isDotNET

public static boolean isDotNET()
Determines whether or not we are running in a .NET environment.

Returns:
true if we are running in a .NET environment.

getOSName

public static java.lang.String getOSName()
Gets a descriptive name for the operating system.

Returns:
A descriptive name for the operating system.

getWSOptions

public static WorkStationOptions getWSOptions()

getMachineName

public static final java.lang.String getMachineName()
Return this machine's name


getHostAddress

public static final java.lang.String getHostAddress()
Return this machine's host IP Address


getEOL

public static final java.lang.String getEOL()
Return the end of line convention.


getFilePathDelim

public static final java.lang.String getFilePathDelim()
Return file name path delimiter.


caseSensitiveFileNames

public static boolean caseSensitiveFileNames()
Returns true if file names are case sensitive.


getTouchCmd

public static java.lang.String getTouchCmd()

getSetReadOnlyCmd

public static java.lang.String getSetReadOnlyCmd()

getSetWritableCmd

public static java.lang.String getSetWritableCmd()

getWorkStationID

public static GUID getWorkStationID()

getLastModified

public static long getLastModified(java.io.File file)
                            throws java.io.IOException
returns the last modified time for the given file via a native platform call

Parameters:
file - File
Returns:
long the last modified time
Throws:
java.io.IOException

getFileLastModified

public static double getFileLastModified(java.io.File file)
                                  throws java.io.IOException
returns the last modified time for the given file via a native platform call

Parameters:
file - File
Returns:
double the last modified time converted to an OLE double
Throws:
java.io.IOException

getLastModified

public static long getLastModified(java.lang.String fileName)
                            throws java.io.IOException
returns the last modified time for the given file via a native platform call

Parameters:
fileName - String the absolute path to the file
Returns:
long the last modified time
Throws:
java.io.IOException

getFileLastModified

public static double getFileLastModified(java.lang.String fileName)
                                  throws java.io.IOException
returns the last modified time for the given file via a native platform call

Parameters:
fileName - String the absolute path to the file
Returns:
long the last modified time
Throws:
java.io.IOException

setFileLastModified

public static void setFileLastModified(java.io.File file,
                                       double oletime)
                                throws java.io.IOException
java.io.IOException

getFileWritable

public static final boolean getFileWritable(java.io.File file)

setFileWritable

public static void setFileWritable(java.io.File file,
                                   boolean val)
                            throws java.io.IOException
java.io.IOException

getFileExecutable

public static boolean getFileExecutable(java.io.File file)
                                 throws java.io.IOException
java.io.IOException

setFileExecutable

public static void setFileExecutable(java.io.File file,
                                     boolean executable)
                              throws java.io.IOException
java.io.IOException

printProps

public static void printProps()


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.