tico.components.resources
Class TFileUtils

java.lang.Object
  extended by tico.components.resources.TFileUtils

public class TFileUtils
extends java.lang.Object

Static class that contains attributes and methods to manage application files.

Version:
1.0 Nov 20, 2006
Author:
Pablo Muñoz

Field Summary
static java.lang.String AVI
          AVI video files extension.
static java.lang.String BRD
          Tico board files extension.
static java.lang.String FLV
          FLV video files extension.
static java.lang.String GIF
          GIF image files extension.
static java.lang.String JPEG
          JPEG image files extension.
static java.lang.String JPG
          JPG image files extension.
static java.lang.String MP3
          MP3 sound files extension.
static java.lang.String MPEG
          MPEG video files extension.
static java.lang.String MPG
          MPG video files extension.
static java.lang.String PNG
          PNG image files extension.
static java.lang.String TCO
          Tico project files extension.
static java.lang.String WAV
          WAV sound files extension.
static java.lang.String WMV
          WMV video files extension.
static java.lang.String XML
          XML files extension.
 
Constructor Summary
TFileUtils()
           
 
Method Summary
static java.lang.String getExtension(java.io.File file)
          Returns the extension of the specified file.
static java.lang.String getExtension(java.lang.String filePath)
          Returns the extension of the specified filePath.
static java.lang.String getFilename(java.io.File file)
          Returns the fileName, without the extension, of the specified file.
static java.lang.String getFilename(java.lang.String filePath)
          Returns the fileName, without the extension, of the specified filePath.
static boolean isBoardFile(java.io.File file)
          Determines if the specified file extension is a Tico board file extension.
static boolean isBoardFile(java.lang.String filePath)
          Determines if the specified filePath extension is a Tico board file extension.
static boolean isImageFile(java.io.File file)
          Determines if the specified file extension is an image file extension.
static boolean isImageFile(java.lang.String filePath)
          Determines if the specified filePath extension is an image file extension.
static boolean isJAIRequired(java.io.File file)
          Determines if the specified file type needs JAI (Java Advanced Imaging API) to be displayed.
static boolean isJAIRequired(java.lang.String filePath)
          Determines if the specified filePath type needs JAI (Java Advanced Imaging API) to be displayed.
static boolean isProjectFile(java.io.File file)
          Determines if the specified file extension is a Tico project file extension.
static boolean isProjectFile(java.lang.String filePath)
          Determines if the specified filePath extension is a Tico project file extension.
static boolean isSoundFile(java.io.File file)
          Determines if the specified file extension is a sound file extension.
static boolean isSoundFile(java.lang.String filePath)
          Determines if the specified filePath extension is a sound file extension.
static boolean isTicoFile(java.io.File file)
          Determines if the specified file extension is a Tico file extension.
static boolean isTicoFile(java.lang.String filePath)
          Determines if the specified filePath extension is a Tico file extension.
static boolean isVideoFile(java.io.File file)
          Determines if the specified file extension is a video file extension.
static boolean isVideoFile(java.lang.String filePath)
          Determines if the specified filePath extension is a video file extension.
static java.lang.String setExtension(java.io.File file, java.lang.String extension)
          Returns a string that contains the specified file replacing its extension with the specified extension.
static java.lang.String setExtension(java.lang.String filePath, java.lang.String extension)
          Returns a string that contains the specified filePath replacing its extension with the specified extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JPEG

public static final java.lang.String JPEG
JPEG image files extension.

See Also:
Constant Field Values

JPG

public static final java.lang.String JPG
JPG image files extension.

See Also:
Constant Field Values

GIF

public static final java.lang.String GIF
GIF image files extension.

See Also:
Constant Field Values

PNG

public static final java.lang.String PNG
PNG image files extension.

See Also:
Constant Field Values

MP3

public static final java.lang.String MP3
MP3 sound files extension.

See Also:
Constant Field Values

WAV

public static final java.lang.String WAV
WAV sound files extension.

See Also:
Constant Field Values

AVI

public static final java.lang.String AVI
AVI video files extension.

See Also:
Constant Field Values

MPG

public static final java.lang.String MPG
MPG video files extension.

See Also:
Constant Field Values

MPEG

public static final java.lang.String MPEG
MPEG video files extension.

See Also:
Constant Field Values

WMV

public static final java.lang.String WMV
WMV video files extension.

See Also:
Constant Field Values

FLV

public static final java.lang.String FLV
FLV video files extension.

See Also:
Constant Field Values

TCO

public static final java.lang.String TCO
Tico project files extension.

See Also:
Constant Field Values

BRD

public static final java.lang.String BRD
Tico board files extension.

See Also:
Constant Field Values

XML

public static final java.lang.String XML
XML files extension.

See Also:
Constant Field Values
Constructor Detail

TFileUtils

public TFileUtils()
Method Detail

getFilename

public static java.lang.String getFilename(java.lang.String filePath)
Returns the fileName, without the extension, of the specified filePath.

Parameters:
filePath - The specified filePath
Returns:
The file name, without the extesion, of the specified filePath

getFilename

public static java.lang.String getFilename(java.io.File file)
Returns the fileName, without the extension, of the specified file.

Parameters:
file - The specified file
Returns:
The file name, without the extesion, of the specified file

getExtension

public static java.lang.String getExtension(java.lang.String filePath)
Returns the extension of the specified filePath.

Parameters:
filePath - The specified filePath
Returns:
The extension of the specified filePath

getExtension

public static java.lang.String getExtension(java.io.File file)
Returns the extension of the specified file.

Parameters:
file - The specified file
Returns:
The extension of the specified file

setExtension

public static java.lang.String setExtension(java.lang.String filePath,
                                            java.lang.String extension)
Returns a string that contains the specified filePath replacing its extension with the specified extension.

Parameters:
filePath - The specified filePath
extension - The specified extension
Returns:
A new file path created replacing the original filePath's extension with the specified extension

setExtension

public static java.lang.String setExtension(java.io.File file,
                                            java.lang.String extension)
Returns a string that contains the specified file replacing its extension with the specified extension.

Parameters:
file - The specified file
extension - The specified extension
Returns:
A new file path created replacing the original file's extension with the specified extension

isImageFile

public static boolean isImageFile(java.lang.String filePath)
Determines if the specified filePath extension is an image file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is an image file extension

isImageFile

public static boolean isImageFile(java.io.File file)
Determines if the specified file extension is an image file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is an image file extension

isJAIRequired

public static boolean isJAIRequired(java.lang.String filePath)
Determines if the specified filePath type needs JAI (Java Advanced Imaging API) to be displayed.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath type needs JAI to be displayed

isJAIRequired

public static boolean isJAIRequired(java.io.File file)
Determines if the specified file type needs JAI (Java Advanced Imaging API) to be displayed.

Parameters:
file - The specified file
Returns:
true if the specified file type needs JAI to be displayed

isSoundFile

public static boolean isSoundFile(java.lang.String filePath)
Determines if the specified filePath extension is a sound file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is a sound file extension

isSoundFile

public static boolean isSoundFile(java.io.File file)
Determines if the specified file extension is a sound file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is a sound file extension

isVideoFile

public static boolean isVideoFile(java.lang.String filePath)
Determines if the specified filePath extension is a video file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is a video file extension

isVideoFile

public static boolean isVideoFile(java.io.File file)
Determines if the specified file extension is a video file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is a video file extension

isProjectFile

public static boolean isProjectFile(java.lang.String filePath)
Determines if the specified filePath extension is a Tico project file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is a Tico project file extension

isProjectFile

public static boolean isProjectFile(java.io.File file)
Determines if the specified file extension is a Tico project file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is a Tico project file extension

isBoardFile

public static boolean isBoardFile(java.lang.String filePath)
Determines if the specified filePath extension is a Tico board file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is a Tico board file extension

isBoardFile

public static boolean isBoardFile(java.io.File file)
Determines if the specified file extension is a Tico board file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is a Tico board file extension

isTicoFile

public static boolean isTicoFile(java.lang.String filePath)
Determines if the specified filePath extension is a Tico file extension.

Parameters:
filePath - The specified filePath
Returns:
true if the specified filePath extension is a Tico file extension

isTicoFile

public static boolean isTicoFile(java.io.File file)
Determines if the specified file extension is a Tico file extension.

Parameters:
file - The specified file
Returns:
true if the specified file extension is a Tico file extension