net.fckeditor.tool
Class UtilsFile

java.lang.Object
  extended by net.fckeditor.tool.UtilsFile

public class UtilsFile
extends java.lang.Object

Some static helper methods in conjunction with files.

Version:
$Id: UtilsFile.java 1690 2008-03-13 13:08:42Z mosipov $

Constructor Summary
UtilsFile()
           
 
Method Summary
static void checkDirAndCreate(java.io.File dir)
          TODO - document me!
static java.lang.String forceSingleExtension(java.lang.String filename)
          TODO - document me!
static boolean isImage(java.io.InputStream in)
          Checks if the underlying file of the InputStrem is an image.
static boolean isSingleExtension(java.lang.String filename)
          TODO - document me!
static boolean isValidPath(java.lang.String path)
          TODO - document me!
static java.lang.String sanitizeFileName(java.lang.String fileName)
          Do a cleanup of the file name to avoid possible problems.
static java.lang.String sanitizeFolderName(java.lang.String folderName)
          Do a cleanup of the folder name to avoid possible problems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilsFile

public UtilsFile()
Method Detail

sanitizeFileName

public static java.lang.String sanitizeFileName(java.lang.String fileName)
Do a cleanup of the file name to avoid possible problems.
The force single Extension property will be respected!

Parameters:
fileName -
Returns:
folder name where \ / | : ? * " < > 'control chars' replaced by '_'

sanitizeFolderName

public static java.lang.String sanitizeFolderName(java.lang.String folderName)
Do a cleanup of the folder name to avoid possible problems.

Parameters:
folderName -
Returns:
folder name where . \ / | : ? * " < > 'control chars' replaced by '_'

isImage

public static boolean isImage(java.io.InputStream in)
Checks if the underlying file of the InputStrem is an image.

Parameters:
in -
Returns:
True, if the underlying file is an image, or false.

isValidPath

public static boolean isValidPath(java.lang.String path)
TODO - document me!

Parameters:
path -
Returns:
true if path corresponds to rules or false.

forceSingleExtension

public static java.lang.String forceSingleExtension(java.lang.String filename)
TODO - document me!

Parameters:
filename -
Returns:
string with a single dot only

isSingleExtension

public static boolean isSingleExtension(java.lang.String filename)
TODO - document me!

Parameters:
filename -
Returns:
true if filename contains severals dots else false

checkDirAndCreate

public static void checkDirAndCreate(java.io.File dir)
TODO - document me!

Parameters:
dir -


Copyright © 2004-2008 Frederico Caldeira Knabben. All Rights Reserved.