@@ -0,0 +1,1490 @@
+package com.cisco.oss.foundation.directory.utils;%0A%0Aimport java.io.File;%0A%0A/**%0A * The Utility for SEI CERT JAVA Secure Code Standard%0A */%0Apublic final class SecureUtils %7B%0A%0A    private SecureUtils() %7B%0A        // private constructor%0A    %7D%0A%0A    public static void validSpecialCharacters(String str) %7B%0A        // Allow only alphanumeric and underscore chars in firstName%0A        // (modify if firstName may also include special characters)%0A        if (!str.matches(%22%5B%5C%5Cw%5D*%22)) %7B%0A            // String does not match whitelisted characters%0A            throw new IllegalArgumentException(str);%0A        %7D%0A    %7D%0A%0A    public static void validateNumber(String str) %7B%0A        try %7B%0A            Integer i = Integer.decode(str);%0A        %7D catch (NumberFormatException e) %7B%0A            throw new IllegalArgumentException(%22Not a number%22 + str);%0A        %7D%0A    %7D%0A%0A    public static String validateSecureFilePath(String name) %7B%0A        // Check for path operation names.%0A        if (name == null %7C%7C name.equals(%22%22) %7C%7C name.equals(%22.%22) %7C%7C name.equals(%22..%22)) %7B%0A            throw new IllegalArgumentException();%0A        %7D%0A        // Null bytes%0A        if (name.indexOf('%5C0') != -1) %7B%0A            throw new IllegalArgumentException();%0A        %7D%0A%0A        // '/' works as a separator on Windows, even though it isn't the%0A        // platform separator character%0A        if ('/' != File.separatorChar && name.indexOf('/') != -1) %7B%0A            throw new IllegalArgumentException();%0A        %7D%0A        return name;%0A    %7D%0A%7D%0A

create secure utility