static String getRed5Root() throws IOException {
        // look for red5 root first as a system property
        String root = System.getProperty("red5.root");
        // if root is null check environmental
        if (root == null) {
            // check for env variable
            root = System.getenv("RED5_HOME");
        }
        // if root is null find out current directory and use it as root
        if (root == null || ".".equals(root)) {
            root = System.getProperty("user.dir");
            // System.out.printf("Current directory: %s%n", root);
        }
        // if were on a windows based os flip the slashes
        if (File.separatorChar != '/') {
            root = root.replaceAll("\\\\", "/");
        }
        // drop last slash if exists
        if (root.charAt(root.length() - 1) == '/') {
            root = root.substring(0, root.length() - 1);
        }
        // set/reset property
        System.setProperty("red5.root", root);
        System.out.printf("Red5 root: %s%n", root);
        return root;
    }