public static String concatPath(String base, String file) {
        if (base == null
            || file.startsWith("/")
            || file.startsWith("\\")
            || (file.length() >= 2 && file.charAt(1) == ':')
            || isUrl(file))
            return file;

        int cut = Math.max(base.lastIndexOf('/'), base.lastIndexOf('\\'));

        return base.substring(0, cut + 1) + file;
    }