org.modeshape.common.text
Class FilenameEncoder
java.lang.Object
org.modeshape.common.text.UrlEncoder
org.modeshape.common.text.FilenameEncoder
- All Implemented Interfaces:
- TextDecoder, TextEncoder
@Immutable
public class FilenameEncoder
- extends UrlEncoder
An encoder useful for converting text to be used within a filename on common file systems and operating systems, including
Linux, OS X, and Windows XP. This encoder is based upon the UrlEncoder
, except that it removes the '*' character from
the list of safe characters.
- See Also:
UrlEncoder
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ESCAPE_CHARACTER
public static final char ESCAPE_CHARACTER
- See Also:
- Constant Field Values
FilenameEncoder
public FilenameEncoder()
encode
public String encode(String text)
- Returns the encoded version of a string.
- Specified by:
encode
in interface TextEncoder
- Overrides:
encode
in class UrlEncoder
- Parameters:
text
- the text with characters that are to be encoded.
- Returns:
- the text with the characters encoded as required, or null if the supplied text is null
- See Also:
TextDecoder.decode(String)
setSlashEncoded
public FilenameEncoder setSlashEncoded(boolean slashEncoded)
- Overrides:
setSlashEncoded
in class UrlEncoder
- Parameters:
slashEncoded
- Sets slashEncoded to the specified value.
- Returns:
- this object, for method chaining
Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.