Crossfire JXClient, Trunk
Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.util.FilenameUtils Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.util.FilenameUtils:
Collaboration graph

Static Public Member Functions

static String quoteName (@NotNull final String name)
 

Private Member Functions

 FilenameUtils ()
 

Static Private Attributes

static final String REPLACEMENT_CHARACTER = "_"
 
static final Pattern UNSAFE_FILENAME_CHARACTERS = Pattern.compile("[^a-zA-Z0-9_.]")
 

Detailed Description

Utility class for manipulating filenames.

Author
Andreas Kirschbaum

Definition at line 32 of file FilenameUtils.java.

Constructor & Destructor Documentation

◆ FilenameUtils()

com.realtime.crossfire.jxclient.util.FilenameUtils.FilenameUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 51 of file FilenameUtils.java.

Member Function Documentation

◆ quoteName()

static String com.realtime.crossfire.jxclient.util.FilenameUtils.quoteName ( @NotNull final String  name)
static

Converts a file name to a "safe" form. The returned file name will not contain any "unsafe" characters (see UNSAFE_FILENAME_CHARACTERS), and it will not be empty.

Parameters
namethe file name to convert
Returns
the converted file name

Definition at line 62 of file FilenameUtils.java.

References com.realtime.crossfire.jxclient.util.FilenameUtils.REPLACEMENT_CHARACTER, and com.realtime.crossfire.jxclient.util.FilenameUtils.UNSAFE_FILENAME_CHARACTERS.

Referenced by com.realtime.crossfire.jxclient.faces.FileCache.getImageFileName().

Here is the caller graph for this function:

Member Data Documentation

◆ REPLACEMENT_CHARACTER

final String com.realtime.crossfire.jxclient.util.FilenameUtils.REPLACEMENT_CHARACTER = "_"
staticprivate

Replaces "unsafe" characters in file names (see UNSAFE_FILENAME_CHARACTERS).

Definition at line 39 of file FilenameUtils.java.

Referenced by com.realtime.crossfire.jxclient.util.FilenameUtils.quoteName().

◆ UNSAFE_FILENAME_CHARACTERS

final Pattern com.realtime.crossfire.jxclient.util.FilenameUtils.UNSAFE_FILENAME_CHARACTERS = Pattern.compile("[^a-zA-Z0-9_.]")
staticprivate

Matches all characters that are considered "unsafe" for file names. These characters will be replaced with REPLACEMENT_CHARACTER.

Definition at line 46 of file FilenameUtils.java.

Referenced by com.realtime.crossfire.jxclient.util.FilenameUtils.quoteName().


The documentation for this class was generated from the following file: