gpt4 book ai didi

org.joda.time.tz.ZoneInfoProvider类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 22:30:49 27 4
gpt4 key购买 nike

本文整理了Java中org.joda.time.tz.ZoneInfoProvider类的一些代码示例,展示了ZoneInfoProvider类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneInfoProvider类的具体详情如下:
包路径:org.joda.time.tz.ZoneInfoProvider
类名称:ZoneInfoProvider

ZoneInfoProvider介绍

[英]ZoneInfoProvider loads compiled data files as generated by ZoneInfoCompiler.

ZoneInfoProvider is thread-safe and publicly immutable.
[中]ZoneInfo Provider加载由ZoneInfo编译器生成的已编译数据文件。
ZoneInfo Provider是线程安全的,并且是公开不可变的。

代码示例

代码示例来源:origin: joda-time/joda-time

if (dataFolder != null) {
    try {
      Provider provider = new ZoneInfoProvider(new File(dataFolder));
      return validateProvider(provider);
    } catch (Exception ex) {
  Provider provider = new ZoneInfoProvider(DEFAULT_TZ_DATA_PATH);
  return validateProvider(provider);
} catch (Exception ex) {

代码示例来源:origin: joda-time/joda-time

return loadZoneData(id);
} else if (id.equals(obj)) {
  return loadZoneData(id);
return getZone((String)obj);

代码示例来源:origin: joda-time/joda-time

/**
 * ZoneInfoProvider searches the given directory for compiled data files.
 *
 * @throws IOException if directory or map file cannot be read
 */
public ZoneInfoProvider(File fileDir) throws IOException {
  if (fileDir == null) {
    throw new IllegalArgumentException("No file directory provided");
  }
  if (!fileDir.exists()) {
    throw new IOException("File directory doesn't exist: " + fileDir);
  }
  if (!fileDir.isDirectory()) {
    throw new IOException("File doesn't refer to a directory: " + fileDir);
  }
  iFileDir = fileDir;
  iResourcePath = null;
  iLoader = null;
  iZoneInfoMap = loadZoneInfoMap(openResource("ZoneInfoMap"));
  iZoneInfoKeys = Collections.unmodifiableSortedSet(new TreeSet<String>(iZoneInfoMap.keySet()));
}

代码示例来源:origin: joda-time/joda-time

/**
 * Loads the time zone data for one id.
 * 
 * @param id  the id to load
 * @return the zone
 */
private DateTimeZone loadZoneData(String id) {
  InputStream in = null;
  try {
    in = openResource(id);
    DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
    iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
    return tz;
  } catch (IOException ex) {
    uncaughtException(ex);
    iZoneInfoMap.remove(id);
    return null;
  } finally {
    try {
      if (in != null) {
        in.close();
      }
    } catch (IOException ex) {
    }
  }
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Loads the zone info map.
 * 
 * @param in  the input stream
 * @return the map
 */
private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
  Map<String, Object> map = new ConcurrentHashMap<String, Object>();
  DataInputStream din = new DataInputStream(in);
  try {
    readZoneInfoMap(din, map);
  } finally {
    try {
      din.close();
    } catch (IOException ex) {
    }
  }
  map.put("UTC", new SoftReference<DateTimeZone>(DateTimeZone.UTC));
  return map;
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Loads the time zone data for one id.
 * 
 * @param id  the id to load
 * @return the zone
 */
private DateTimeZone loadZoneData(String id) {
  InputStream in = null;
  try {
    in = openResource(id);
    DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
    iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
    return tz;
  } catch (IOException ex) {
    uncaughtException(ex);
    iZoneInfoMap.remove(id);
    return null;
  } finally {
    try {
      if (in != null) {
        in.close();
      }
    } catch (IOException ex) {
    }
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Loads the zone info map.
 * 
 * @param in  the input stream
 * @return the map
 */
private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
  Map<String, Object> map = new ConcurrentHashMap<String, Object>();
  DataInputStream din = new DataInputStream(in);
  try {
    readZoneInfoMap(din, map);
  } finally {
    try {
      din.close();
    } catch (IOException ex) {
    }
  }
  map.put("UTC", new SoftReference<DateTimeZone>(DateTimeZone.UTC));
  return map;
}

代码示例来源:origin: joda-time/joda-time

/**
 * @param favorSystemLoader when true, use the system class loader if
 * loader null. When false, use the current class loader if loader is null.
 */
private ZoneInfoProvider(String resourcePath,
             ClassLoader loader, boolean favorSystemLoader) 
  throws IOException
{
  if (resourcePath == null) {
    throw new IllegalArgumentException("No resource path provided");
  }
  if (!resourcePath.endsWith("/")) {
    resourcePath += '/';
  }
  iFileDir = null;
  iResourcePath = resourcePath;
  if (loader == null && !favorSystemLoader) {
    loader = getClass().getClassLoader();
  }
  iLoader = loader;
  iZoneInfoMap = loadZoneInfoMap(openResource("ZoneInfoMap"));
  iZoneInfoKeys = Collections.unmodifiableSortedSet(new TreeSet<String>(iZoneInfoMap.keySet()));
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Loads the time zone data for one id.
 * 
 * @param id  the id to load
 * @return the zone
 */
private DateTimeZone loadZoneData(String id) {
  InputStream in = null;
  try {
    in = openResource(id);
    DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
    iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
    return tz;
  } catch (IOException ex) {
    uncaughtException(ex);
    iZoneInfoMap.remove(id);
    return null;
  } finally {
    try {
      if (in != null) {
        in.close();
      }
    } catch (IOException ex) {
    }
  }
}

代码示例来源:origin: JodaOrg/joda-time

return loadZoneData(id);
} else if (id.equals(obj)) {
  return loadZoneData(id);
return getZone((String)obj);

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Loads the zone info map.
 * 
 * @param in  the input stream
 * @return the map
 */
private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
  Map<String, Object> map = new ConcurrentHashMap<String, Object>();
  DataInputStream din = new DataInputStream(in);
  try {
    readZoneInfoMap(din, map);
  } finally {
    try {
      din.close();
    } catch (IOException ex) {
    }
  }
  map.put("UTC", new SoftReference<DateTimeZone>(DateTimeZone.UTC));
  return map;
}

代码示例来源:origin: JodaOrg/joda-time

if (dataFolder != null) {
    try {
      Provider provider = new ZoneInfoProvider(new File(dataFolder));
      return validateProvider(provider);
    } catch (Exception ex) {
  Provider provider = new ZoneInfoProvider(DEFAULT_TZ_DATA_PATH);
  return validateProvider(provider);
} catch (Exception ex) {

代码示例来源:origin: JodaOrg/joda-time

/**
 * ZoneInfoProvider searches the given directory for compiled data files.
 *
 * @throws IOException if directory or map file cannot be read
 */
public ZoneInfoProvider(File fileDir) throws IOException {
  if (fileDir == null) {
    throw new IllegalArgumentException("No file directory provided");
  }
  if (!fileDir.exists()) {
    throw new IOException("File directory doesn't exist: " + fileDir);
  }
  if (!fileDir.isDirectory()) {
    throw new IOException("File doesn't refer to a directory: " + fileDir);
  }
  iFileDir = fileDir;
  iResourcePath = null;
  iLoader = null;
  iZoneInfoMap = loadZoneInfoMap(openResource("ZoneInfoMap"));
  iZoneInfoKeys = Collections.unmodifiableSortedSet(new TreeSet<String>(iZoneInfoMap.keySet()));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Loads the time zone data for one id.
 * 
 * @param id  the id to load
 * @return the zone
 */
private DateTimeZone loadZoneData(String id) {
  InputStream in = null;
  try {
    in = openResource(id);
    DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
    iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
    return tz;
  } catch (IOException ex) {
    uncaughtException(ex);
    iZoneInfoMap.remove(id);
    return null;
  } finally {
    try {
      if (in != null) {
        in.close();
      }
    } catch (IOException ex) {
    }
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

return loadZoneData(id);
  return loadZoneData(id);
return getZone((String)obj);

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Loads the zone info map.
 * 
 * @param in  the input stream
 * @return the map
 */
private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
  Map<String, Object> map = new ConcurrentHashMap<String, Object>();
  DataInputStream din = new DataInputStream(in);
  try {
    readZoneInfoMap(din, map);
  } finally {
    try {
      din.close();
    } catch (IOException ex) {
    }
  }
  map.put("UTC", new SoftReference<DateTimeZone>(DateTimeZone.UTC));
  return map;
}

代码示例来源:origin: camunda/camunda-bpm-platform

provider = new ZoneInfoProvider("org/joda/time/tz/data");
} catch (Exception ex) {
  Thread thread = Thread.currentThread();

代码示例来源:origin: JodaOrg/joda-time

/**
 * @param favorSystemLoader when true, use the system class loader if
 * loader null. When false, use the current class loader if loader is null.
 */
private ZoneInfoProvider(String resourcePath,
             ClassLoader loader, boolean favorSystemLoader) 
  throws IOException
{
  if (resourcePath == null) {
    throw new IllegalArgumentException("No resource path provided");
  }
  if (!resourcePath.endsWith("/")) {
    resourcePath += '/';
  }
  iFileDir = null;
  iResourcePath = resourcePath;
  if (loader == null && !favorSystemLoader) {
    loader = getClass().getClassLoader();
  }
  iLoader = loader;
  iZoneInfoMap = loadZoneInfoMap(openResource("ZoneInfoMap"));
  iZoneInfoKeys = Collections.unmodifiableSortedSet(new TreeSet<String>(iZoneInfoMap.keySet()));
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Loads the time zone data for one id.
 * 
 * @param id  the id to load
 * @return the zone
 */
private DateTimeZone loadZoneData(String id) {
  InputStream in = null;
  try {
    in = openResource(id);
    DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
    iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
    return tz;
  } catch (IOException ex) {
    uncaughtException(ex);
    iZoneInfoMap.remove(id);
    return null;
  } finally {
    try {
      if (in != null) {
        in.close();
      }
    } catch (IOException ex) {
    }
  }
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

return loadZoneData(id);
  return loadZoneData(id);
return getZone((String)obj);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com