public class Str extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Str.UnsafeName |
Constructor and Description |
---|
Str() |
Modifier and Type | Method and Description |
---|---|
static void |
ensureSafe(String name)
Throws an exception if the string does not match [a-zA-Z0-9_-]+, otherwise a no-op.
|
static boolean |
isSafe(String name)
Whether or not the given string matches [a-zA-Z0-9_-]+
|
static String |
safe(String name)
Returns a String suitable to be used in multiple contexts, e.g., as part of a filename.
|
public static String safe(String name)
name
- a string to make safepublic static boolean isSafe(String name)
name
- the string to checkpublic static void ensureSafe(String name) throws Str.UnsafeName
name
- the string to checkStr.UnsafeName
- if the name is not safeCopyright © 2015 SeqWare. All rights reserved.