package com.perforce.common.process; public class ProcessUser { /** * Filter reserved characters from the username. Empty usernames are * populated with 'unknown'. * * Remove '@', '*', '%', '...' and '#', but replace ' ' with '_' * * @param user * @return */ public static String filter(String user) { user = user.replace("@", ""); user = user.replace("#", ""); user = user.replace(" ", "_"); user = user.replace("*", ""); user = user.replace("%%", ""); user = user.replace("...", ""); if (user.isEmpty()) { user = "unknown"; } return user; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12446 | Paul Allen | Branching using p4convert-rusty | ||
//guest/perforce_software/p4convert/src/com/perforce/common/process/ProcessUser.java | |||||
#1 | 10636 | Paul Allen |
Added fix for CVS users with reserved chars in the name. CVS TestCase: username_comma, username_rev_chars |