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 | 13876 | Paul Allen | Rename/move file(s) | ||
//guest/paul_allen/p4convert-maven/src/com/perforce/common/process/ProcessUser.java | |||||
#1 | 13873 | Paul Allen | Branching using p4convert-maven | ||
//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 |