Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.util
Class FileUtils

java.lang.Object
  extended by net.java.sip.communicator.util.FileUtils

public class FileUtils
extends Object

Utility class that allows to check if a given file is an image or to obtain the file thumbnail icon.

Author:
Yana Stamcheva

Constructor Summary
FileUtils()
           
 
Method Summary
static Icon getIcon(File file)
          Returns the native icon of the given file if one exists, otherwise returns null.
static boolean isImage(String fileName)
          Returns true if the file given by fileName is an image, false - otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

isImage

public static boolean isImage(String fileName)
Returns true if the file given by fileName is an image, false - otherwise.

Parameters:
fileName - the name of the file to check
Returns:
true if the file is an image, false - otherwise.

getIcon

public static Icon getIcon(File file)
Returns the native icon of the given file if one exists, otherwise returns null.

Parameters:
file - the file to obtain icon for
Returns:
the native icon of the given file if one exists, otherwise returns null. TODO: Use JNA to implement this under Linux.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.