本文整理了Java中com.intellij.openapi.util.io.FileUtil.isAbsolute()
方法的一些代码示例,展示了FileUtil.isAbsolute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.isAbsolute()
方法的具体详情如下:
包路径:com.intellij.openapi.util.io.FileUtil
类名称:FileUtil
方法名:isAbsolute
暂无
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
private static String getPath(Project project, String path) {
if (!FileUtil.isAbsolute(path)) { // Project relative path
path = project.getBasePath() + "/" + path;
}
return path;
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
protected File getTranslationRoot() {
String translationPath = Settings.getInstance(this.project).pathToTranslation;
if (!FileUtil.isAbsolute(translationPath)) {
translationPath = project.getBasePath() + "/" + translationPath;
}
File file = new File(translationPath);
if(!file.exists() || !file.isDirectory()) {
return null;
}
return file;
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
public boolean exists(@NotNull Project project) {
if (!FileUtil.isAbsolute(this.path)) {
return VfsUtil.findRelativeFile(this.path, project.getBaseDir()) != null;
}
return new File(this.path).exists();
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
public VirtualFile getDirectory(@NotNull Project project) {
if(!FileUtil.isAbsolute(path)) {
return VfsUtil.findRelativeFile(path, project.getBaseDir());
} else {
VirtualFile fileByIoFile = VfsUtil.findFileByIoFile(new File(path), true);
if(fileByIoFile != null) {
return fileByIoFile;
}
}
return null;
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
public String getRelativePath(@NotNull Project project) {
if(!FileUtil.isAbsolute(path)) {
return path;
}
VirtualFile virtualFile = getDirectory();
if(virtualFile == null) {
return null;
}
return VfsUtil.getRelativePath(virtualFile, project.getBaseDir(), '/');
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
public File getFile(Project project) {
if (!FileUtil.isAbsolute(this.path)) {
VirtualFile virtualFile = VfsUtil.findRelativeFile(this.path, project.getBaseDir());
if(virtualFile == null) {
return null;
}
return VfsUtil.virtualToIoFile(virtualFile);
}
File file = new File(this.path);
if(!file.exists()) {
return null;
}
return file;
}
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
if(FileUtil.isAbsolute(directoryToApp)) {
代码示例来源:origin: groboclown/p4ic4idea
@Nullable
private VirtualFile getRelFile(@NotNull String path) {
if (FileUtil.isAbsolute(path)) {
return LocalFileSystem.getInstance().findFileByPath(path);
}
return getFileAt(vcsRoot.getPath(), path);
}
内容来源于网络,如有侵权,请联系作者删除!