org.littleshoot.util
Class FileUtils

java.lang.Object
  extended by org.littleshoot.util.FileUtils

public final class FileUtils
extends Object

This class provides static functions to load/store the files.


Method Summary
static boolean hasFileExtension(File file)
          Utility method for checking whether or not the given file has an extension.
static boolean hasFileExtension(String name)
          Utility method for checking whether or not the given file name has an extension.
static String removeIllegalCharsFromFileName(String name)
          Replaces OS specific illegal characters from any filename with '_', including ( / \n \r \t ) on all operating systems, ( ? * \ < > | " ) on Windows, ( ` ) on unix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasFileExtension

public static boolean hasFileExtension(File file)
Utility method for checking whether or not the given file has an extension.

Parameters:
file - The file to check for an extension on.
Returns:
true if the given file has an extension, otherwise false

hasFileExtension

public static boolean hasFileExtension(String name)
Utility method for checking whether or not the given file name has an extension.

Parameters:
name - The file name to check for an extension on.
Returns:
true if the given file name has an extension, otherwise false

removeIllegalCharsFromFileName

public static String removeIllegalCharsFromFileName(String name)
Replaces OS specific illegal characters from any filename with '_', including ( / \n \r \t ) on all operating systems, ( ? * \ < > | " ) on Windows, ( ` ) on unix.

Parameters:
name - the filename to check for illegal characters
Returns:
String containing the cleaned filename


Copyright © 2011-2013 LittleShoot. All Rights Reserved.