Class Overview
This is a centralized object for checking illegal characters in attachment file names. This is used by the
AttachmentManager, the Screenshot Applet, the Abstract Message Handler and others.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
public
FileNameCharacterCheckerUtil
()
Public Methods
public
String
assertFileNameDoesNotContainInvalidChars
(String filename)
This will test the given filename string for any invalid characters. If it contains an invalid
character then the string returned will be the character. A return value of null means that the
string is a valid filename. if the filename is null it will return null for the caller to handle
the null filename.
Parameters
filename
| the filename to be checked. |
Returns
- null if the filename is valid, else the character that is invalid.
public
static
char[]
getInvalidCharacters
()
public
String
getPrintableInvalidCharacters
()
public
String
replaceInvalidChars
(String filename, char replacementChar)
Replaces each invalid character of the given filename with the replacementChar. If the filename is null, returns
null so that the caller can handle the null filename
Parameters
filename
| file name to replace invalid characters from |
replacementChar
| character to replace invalid characters |
Returns
- new filename with valid characters