本文整理了Java中org.apache.commons.io.FileUtils.getUserDirectoryPath()
方法的一些代码示例,展示了FileUtils.getUserDirectoryPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.getUserDirectoryPath()
方法的具体详情如下:
包路径:org.apache.commons.io.FileUtils
类名称: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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!