public String simplifyPath(String path) {
            if (path == null) {
                return null;
            }
            if (path.trim().length() == 0) {
                return "/";
            }
            StringBuffer stringBuffer = new StringBuffer();
            Stack<String> stack = new Stack<String>();
            String[] paths = path.split("/");
            for (String i : paths) {
                if (i.length() == 0) {
                    continue;
                }
                if (i.equals("..")) {
                    if (!stack.empty()) {
                        stack.pop();
                    }
                } else {
                    if (!i.equals(".")) {
                        stack.push(i);
                    }
                }
            }
            if (stack.size() == 0) {
                return "/";
            }
            for (String i : stack.toArray(new String[stack.size()])) {
                stringBuffer.append("/" + i);
            }
            return stringBuffer.toString();
        }