com.realtime.crossfire.jxclient.util
Class FilenameUtils

java.lang.Object
  extended by com.realtime.crossfire.jxclient.util.FilenameUtils

public class FilenameUtils
extends java.lang.Object

Utility class for manipulating filenames.


Field Summary
private static java.lang.String REPLACEMENT_CHARACTER
          Replaces "unsafe" characters in file names (see UNSAFE_FILENAME_CHARACTERS).
private static java.util.regex.Pattern UNSAFE_FILENAME_CHARACTERS
          Matches all characters that are considered "unsafe" for file names.
 
Constructor Summary
private FilenameUtils()
          Private constructor to prevent instantiation.
 
Method Summary
static java.lang.String quoteName(java.lang.String name)
          Converts a file name to a "safe" form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPLACEMENT_CHARACTER

@NotNull
private static final java.lang.String REPLACEMENT_CHARACTER
Replaces "unsafe" characters in file names (see UNSAFE_FILENAME_CHARACTERS).

See Also:
Constant Field Values

UNSAFE_FILENAME_CHARACTERS

@NotNull
private static final java.util.regex.Pattern UNSAFE_FILENAME_CHARACTERS
Matches all characters that are considered "unsafe" for file names. These characters will be replaced with REPLACEMENT_CHARACTER.

Constructor Detail

FilenameUtils

private FilenameUtils()
Private constructor to prevent instantiation.

Method Detail

quoteName

@NotNull
public static java.lang.String quoteName(@NotNull
                                                 java.lang.String name)
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:
name - the file name to convert
Returns:
the converted file name