@SuppressWarnings("PMD.UndefineMagicConstantRule")
    public static Map<String, ServiceInfo> parseServiceInfoFromCache(File file) throws UnsupportedEncodingException {
        Map<String, ServiceInfo> result = new HashMap<>(1);
        String fileName = URLDecoder.decode(file.getName(), "UTF-8");
        if (!(fileName.endsWith(Constants.SERVICE_INFO_SPLITER + "meta") || fileName
                .endsWith(Constants.SERVICE_INFO_SPLITER + "special-url"))) {
            ServiceInfo dom = new ServiceInfo(fileName);
            List<Instance> ips = new ArrayList<>();
            dom.setHosts(ips);
            ServiceInfo newFormat = null;
            try (BufferedReader reader = new BufferedReader(
                    new StringReader(ConcurrentDiskUtil.getFileContent(file, Charset.defaultCharset().toString())))) {
                
                String json;
                while ((json = reader.readLine()) != null) {
                    try {
                        if (!json.startsWith("{")) {
                            continue;
                        }
                        
                        newFormat = JacksonUtils.toObj(json, ServiceInfo.class);
                        
                        if (StringUtils.isEmpty(newFormat.getName())) {
                            ips.add(JacksonUtils.toObj(json, Instance.class));
                        }
                    } catch (Throwable e) {
                        NAMING_LOGGER.error("[NA] error while parsing cache file: " + json, e);
                    }
                }
            } catch (Exception e) {
                NAMING_LOGGER.error("[NA] failed to read cache for dom: " + file.getName(), e);
            }
            if (newFormat != null && !StringUtils.isEmpty(newFormat.getName()) && !CollectionUtils
                    .isEmpty(newFormat.getHosts())) {
                result.put(dom.getKey(), newFormat);
            } else if (!CollectionUtils.isEmpty(dom.getHosts())) {
                result.put(dom.getKey(), dom);
            }
        }
        return result;
    }
@Test
    void testParseServiceInfoFromNonExistFile() throws UnsupportedEncodingException {
        File file = new File("non%40%40exist%40%40file");
        Map<String, ServiceInfo> actual = DiskCache.parseServiceInfoFromCache(file);
        assertTrue(actual.isEmpty());
    }