String (String userHome, String selector, @Nullable String xdgVar, String xdgDfl, String xdgSub) { String dir = xdgVar != null ? System.getenv(xdgVar) : null; if (dir == null || dir.isEmpty()) dir = userHome + '/' + xdgDfl; dir = dir + '/' + vendorName(); if (!selector.isEmpty()) dir = dir + '/' + selector; if (!xdgSub.isEmpty()) dir = dir + '/' + xdgSub; return dir; }