Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.util.FilenameUtils Class Reference

Utility class for manipulating filenames. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.util.FilenameUtils:

Static Public Member Functions

static String quoteName (@NotNull final String name)
 Converts a file name to a "safe" form. More...
 

Private Member Functions

 FilenameUtils ()
 Private constructor to prevent instantiation. More...
 

Static Private Attributes

static final String REPLACEMENT_CHARACTER = "_"
 Replaces "unsafe" characters in file names (see UNSAFE_FILENAME_CHARACTERS). More...
 
static final Pattern UNSAFE_FILENAME_CHARACTERS = Pattern.compile("[^a-zA-Z0-9_.]")
 Matches all characters that are considered "unsafe" for file names. More...
 

Detailed Description

Utility class for manipulating filenames.

Author
Andreas Kirschbaum

Definition at line 31 of file FilenameUtils.java.

Constructor & Destructor Documentation

◆ FilenameUtils()

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

Private constructor to prevent instantiation.

Definition at line 50 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 61 of file FilenameUtils.java.

References com.realtime.crossfire.jxclient.util.FilenameUtils.REPLACEMENT_CHARACTER.

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 38 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 45 of file FilenameUtils.java.


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