org.apache.commons.io.FileUtils.getUserDirectoryPath()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(227)

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

FileUtils.getUserDirectoryPath介绍

[英]Returns the path to the user's home directory.
[中]返回用户主目录的路径。

代码示例

代码示例来源:origin: commons-io/commons-io

/**
 * Returns a {@link File} representing the user's home directory.
 *
 * @return the user's home directory.
 *
 * @since 2.0
 */
public static File getUserDirectory() {
  return new File(getUserDirectoryPath());
}

代码示例来源:origin: SonarSource/sonarqube

String getPathToSecretKey() {
 if (StringUtils.isBlank(pathToSecretKey)) {
  pathToSecretKey = new File(FileUtils.getUserDirectoryPath(), ".sonar/sonar-secret.txt").getPath();
 }
 return pathToSecretKey;
}

代码示例来源:origin: commons-io/commons-io

@Test
public void testGetUserDirectoryPath() {
  assertEquals(System.getProperty("user.home"),
      FileUtils.getUserDirectoryPath());
}

代码示例来源:origin: org.xworker/xworker_core

public static String getUserDirectoryPath(ActionContext actionContext){
  return FileUtils.getUserDirectoryPath();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Returns a {@link File} representing the user's home directory.
 *
 * @return the user's home directory.
 *
 * @since 2.0
 */
public static File getUserDirectory() {
  return new File(getUserDirectoryPath());
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * Returns a {@link File} representing the user's home directory.
 *
 * @return the user's home directory.
 *
 * @since 2.0
 */
public static File getUserDirectory() {
  return new File(getUserDirectoryPath());
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Returns a {@link File} representing the user's home directory.
 * 
 * @return the user's home directory.
 * 
 * @since 2.0
 */
public static File getUserDirectory() {
  return new File(getUserDirectoryPath());
}

代码示例来源:origin: Nextdoor/bender

/**
 * Returns a {@link File} representing the user's home directory.
 * 
 * @return the user's home directory.
 * 
 * @since 2.0
 */
public static File getUserDirectory() {
  return new File(getUserDirectoryPath());
}

代码示例来源:origin: org.kuali.common/kuali-util

public static final File getDefaultLocalRepositoryDir() {
  return new File(FileUtils.getUserDirectoryPath() + FS + DEFAULT_MAVEN_REPO_PATH);
}

代码示例来源:origin: org.kuali.common/kuali-util

public static File getDefaultLocalRepository() {
  return new File(getUserDirectoryPath() + FS + DEFAULT_MAVEN_REPO_PATH);
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

@VisibleForTesting
String getPathToSecretKey() {
 if (StringUtils.isBlank(pathToSecretKey)) {
  pathToSecretKey = new File(FileUtils.getUserDirectoryPath(), ".sonar/sonar-secret.txt").getPath();
 }
 return pathToSecretKey;
}

代码示例来源:origin: org.codehaus.sonar/sonar-process

String getPathToSecretKey() {
  if (StringUtils.isBlank(pathToSecretKey)) {
   pathToSecretKey = new File(FileUtils.getUserDirectoryPath(), ".sonar/sonar-secret.txt").getPath();
  }
  return pathToSecretKey;
 }
}

代码示例来源:origin: org.smartrplace.apps/smartrplace-util-proposed

public static Path resolvePath(String path) {
    if(path.startsWith("$home")) {
      return Paths.get(FileUtils.getUserDirectoryPath(), path.substring(6));
    } else {
      return Paths.get(path);
    }
  }
}

相关文章

FileUtils类方法