本文整理了Java中com.thoughtworks.go.util.FileUtil.toFileURI()
方法的一些代码示例,展示了FileUtil.toFileURI()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.toFileURI()
方法的具体详情如下:
包路径:com.thoughtworks.go.util.FileUtil
类名称:FileUtil
方法名:toFileURI
暂无
代码示例来源:origin: gocd/gocd
public static String getRepoUrl(File repositoryRoot, String project) {
String url = FileUtil.toFileURI(new File(repositoryRoot, project));
return url.replaceAll(" ", "%20");
}
代码示例来源:origin: gocd/gocd
public String projectRepositoryUrl() {
return FileUtil.toFileURI(gitRepo);
}
代码示例来源:origin: gocd/gocd
public String projectRepositoryUrl() {
return FileUtil.toFileURI(remoteRepoDir.getAbsoluteFile());
}
代码示例来源:origin: gocd/gocd
public String repositoryUrl(String project) {
return FileUtil.toFileURI(new File(tempRepo, project));
}
代码示例来源:origin: gocd/gocd
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = {EnhancedOSChecker.WINDOWS})
public void shouldCreateFileURIForFileOnWindows() {
assertThat(FileUtil.toFileURI(new File("c:\\foo")).startsWith("file:///c:/foo"), is(true));
assertThat(FileUtil.toFileURI(new File("c:\\a dir with spaces\\foo")).startsWith("file:///c:/a%20dir%20with%20spaces/foo"), is(true));
}
代码示例来源:origin: gocd/gocd
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = {DO_NOT_RUN_ON, WINDOWS})
public void shouldCreateFileURIForFile() {
assertThat(FileUtil.toFileURI(new File("/var/lib/foo/")), is("file:///var/lib/foo"));
assertThat(FileUtil.toFileURI(new File("/var/a dir with spaces/foo")), is("file:///var/a%20dir%20with%20spaces/foo"));
assertThat(FileUtil.toFileURI(new File("/var/司徒空在此/foo")), is("file:///var/%E5%8F%B8%E5%BE%92%E7%A9%BA%E5%9C%A8%E6%AD%A4/foo"));
}
内容来源于网络,如有侵权,请联系作者删除!