org.eclipse.jgit.util.FS.userHomeImpl()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(103)

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

FS.userHomeImpl介绍

[英]Determine the user's home directory (location where preferences are).
[中]确定用户的主目录(首选项所在的位置)。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Determine the user's home directory (location where preferences are).
 * <p>
 * This method can be expensive on the first invocation if path name
 * translation is required. Subsequent invocations return a cached result.
 * <p>
 * Not all platforms and JREs require path name translation. Currently only
 * Cygwin on Win32 requires translation of the Cygwin HOME directory.
 *
 * @return the user's home directory; null if the user does not have one.
 */
public File userHome() {
  Holder<File> p = userHome;
  if (p == null) {
    p = new Holder<>(userHomeImpl());
    userHome = p;
  }
  return p.value;
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
protected File userHomeImpl() {
  String home = SystemReader.getInstance().getenv("HOME"); //$NON-NLS-1$
  if (home != null)
    return resolve(null, home);
  String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); //$NON-NLS-1$
  if (homeDrive != null) {
    String homePath = SystemReader.getInstance().getenv("HOMEPATH"); //$NON-NLS-1$
    if (homePath != null)
      return new File(homeDrive, homePath);
  }
  String homeShare = SystemReader.getInstance().getenv("HOMESHARE"); //$NON-NLS-1$
  if (homeShare != null)
    return new File(homeShare);
  return super.userHomeImpl();
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * Determine the user's home directory (location where preferences are).
 * <p>
 * This method can be expensive on the first invocation if path name
 * translation is required. Subsequent invocations return a cached result.
 * <p>
 * Not all platforms and JREs require path name translation. Currently only
 * Cygwin on Win32 requires translation of the Cygwin HOME directory.
 *
 * @return the user's home directory; null if the user does not have one.
 */
public File userHome() {
  Holder<File> p = userHome;
  if (p == null) {
    p = new Holder<File>(userHomeImpl());
    userHome = p;
  }
  return p.value;
}

代码示例来源:origin: berlam/github-bucket

/**
 * Determine the user's home directory (location where preferences are).
 * <p>
 * This method can be expensive on the first invocation if path name
 * translation is required. Subsequent invocations return a cached result.
 * <p>
 * Not all platforms and JREs require path name translation. Currently only
 * Cygwin on Win32 requires translation of the Cygwin HOME directory.
 *
 * @return the user's home directory; null if the user does not have one.
 */
public File userHome() {
  Holder<File> p = userHome;
  if (p == null) {
    p = new Holder<>(userHomeImpl());
    userHome = p;
  }
  return p.value;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

@Override
protected File userHomeImpl() {
  String home = SystemReader.getInstance().getenv("HOME"); //$NON-NLS-1$
  if (home != null)
    return resolve(null, home);
  String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); //$NON-NLS-1$
  if (homeDrive != null) {
    String homePath = SystemReader.getInstance().getenv("HOMEPATH"); //$NON-NLS-1$
    if (homePath != null)
      return new File(homeDrive, homePath);
  }
  String homeShare = SystemReader.getInstance().getenv("HOMESHARE"); //$NON-NLS-1$
  if (homeShare != null)
    return new File(homeShare);
  return super.userHomeImpl();
}

代码示例来源:origin: berlam/github-bucket

/** {@inheritDoc} */
@Override
protected File userHomeImpl() {
  String home = SystemReader.getInstance().getenv("HOME"); //$NON-NLS-1$
  if (home != null)
    return resolve(null, home);
  String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); //$NON-NLS-1$
  if (homeDrive != null) {
    String homePath = SystemReader.getInstance().getenv("HOMEPATH"); //$NON-NLS-1$
    if (homePath != null)
      return new File(homeDrive, homePath);
  }
  String homeShare = SystemReader.getInstance().getenv("HOMESHARE"); //$NON-NLS-1$
  if (homeShare != null)
    return new File(homeShare);
  return super.userHomeImpl();
}

相关文章