+ private String handleSpecialFolderNames(String tokenInput){
+ List<String> pathsToCheck = Arrays.asList("Files/trash", "Files/shared", "Files/others");
+ if(pathsToCheck.contains(tokenInput))
+ return tokenInput + "/";
+ return tokenInput;
+
+ }
+
+ /**
+ * Reject illegal resource names, like '.' or '..' or slashes '/'.
+ */
+ static boolean isValidResourceName(String name) {
+ if (".".equals(name) || "..".equals(name) || name.contains("/"))
+ return false;
+ return true;
+ }
+
+ public void putUserToMap(String _userName, String _userFullName){
+ userFullNameMap.put(_userName, _userFullName);
+ }
+
+ public String findUserFullName(String _userName){
+ return userFullNameMap.get(_userName);
+ }
+
+ public String getUserFullName(String _userName) {
+ if (GSS.get().findUserFullName(_userName) == null)
+ //if there is no userFullName found then the map fills with the given _userName,
+ //so userFullName = _userName
+ GSS.get().putUserToMap(_userName, _userName);
+ else if(GSS.get().findUserFullName(_userName).indexOf('@') != -1){
+ //if the userFullName = _userName the GetUserCommand updates the userFullName in the map
+ GetUserCommand guc = new GetUserCommand(_userName);
+ guc.execute();
+ }
+ return GSS.get().findUserFullName(_userName);