sears.tools
Class Utils

java.lang.Object
  extended by sears.tools.Utils

public class Utils
extends java.lang.Object

Class Utils.
Summary:
This class provides some usefull subtitles and general tools.


Field Summary
static java.lang.String gif
           
static java.lang.String jpeg
           
static java.lang.String jpg
           
static java.lang.String png
           
static java.lang.String tif
           
static java.lang.String tiff
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void copyFile(java.io.File src, java.io.File dst)
          Method copyFile.
static void copyStream(java.io.InputStream src, java.io.OutputStream dst)
          Method copyStream.
static java.lang.String formatTime(int timeInSecond)
          Method formatTime.
static java.lang.String getExtension(java.io.File file)
          Method getExtension.
static boolean isWindowsPlatform()
          Method isWindowsPlatform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jpeg

public static final java.lang.String jpeg
See Also:
Constant Field Values

jpg

public static final java.lang.String jpg
See Also:
Constant Field Values

gif

public static final java.lang.String gif
See Also:
Constant Field Values

tiff

public static final java.lang.String tiff
See Also:
Constant Field Values

tif

public static final java.lang.String tif
See Also:
Constant Field Values

png

public static final java.lang.String png
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

getExtension

public static java.lang.String getExtension(java.io.File file)
Method getExtension.
Summary:
return the file extension of a given file. ex: from test.jpg, return String jpg

Parameters:
file - The File file to get the extension
Returns:
String The file extension.

isWindowsPlatform

public static boolean isWindowsPlatform()
Method isWindowsPlatform.
Summary:
Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.

Returns:
true if this application is running under a Windows OS

copyStream

public static void copyStream(java.io.InputStream src,
                              java.io.OutputStream dst)
                       throws java.io.IOException
Method copyStream.
Summary:
Copies src stream to dst stream. If the dst stream does not exist, it is created.

Parameters:
src - The File source stream
dst - The File destination stream
Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File src,
                            java.io.File dst)
                     throws java.io.IOException
Method copyFile.
Summary:
Copies src file to dst file. If the dst file does not exist, it is created.

Parameters:
src - The File source file
dst - The File destination file
Throws:
java.io.IOException

formatTime

public static java.lang.String formatTime(int timeInSecond)
Method formatTime.
Summary:
Format time in second to "HH:MM:SS".

Parameters:
timeInSecond - The int time in second
Returns:
the formated time