类 DiskCache

java.lang.Object
com.alibaba.nacos.client.naming.cache.DiskCache

public class DiskCache extends Object
Disk cache.
作者:
xuanyin
  • 构造器详细资料

    • DiskCache

      public DiskCache()
  • 方法详细资料

    • write

      public static void write(com.alibaba.nacos.api.naming.pojo.ServiceInfo dom, String dir)
      Write service info to dir.
      参数:
      dom - service info
      dir - directory
    • getLineSeparator

      public static String getLineSeparator()
    • read

      public static Map<String,com.alibaba.nacos.api.naming.pojo.ServiceInfo> read(String cacheDir)
      Read service info from disk.
      参数:
      cacheDir - cache file dir
      返回:
      service infos
    • parseServiceInfoFromCache

      public static Map<String,com.alibaba.nacos.api.naming.pojo.ServiceInfo> parseServiceInfoFromCache(File file) throws UnsupportedEncodingException
      Parse Service info from cache file or failover file.
      参数:
      file - cache file or failover file
      返回:
      Service info
      抛出:
      UnsupportedEncodingException - if the file is not encoded in UTF-8
    • createFileIfAbsent

      public static void createFileIfAbsent(File file, boolean isDir) throws IOException
      Create file if absent.
      参数:
      file - file
      isDir - is dir
      抛出:
      IOException - if any io exception during create.