java 从资源目录获取txt内容

public String getCookie() {
        ClassPathResource classPathResource = new ClassPathResource("cookie.txt");
        String ck = FileUtil.readString(classPathResource.getAbsolutePath(), CharsetUtil.CHARSET_UTF_8);
        return ck;
    }