本文整理了Java中com.intellij.openapi.util.io.FileUtil.pathsEqual()
方法的一些代码示例,展示了FileUtil.pathsEqual()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.pathsEqual()
方法的具体详情如下:
包路径:com.intellij.openapi.util.io.FileUtil
类名称:FileUtil
方法名:pathsEqual
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public boolean isConfigurationFromContext(@NotNull T configuration, ConfigurationContext context) {
GoFile file = getFileFromContext(context);
return file != null && FileUtil.pathsEqual(configuration.getFilePath(), file.getVirtualFile().getPath());
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
public boolean isConfigurationFromContext(@NotNull T configuration, ConfigurationContext context) {
BallerinaFile file = getFileFromContext(context);
return file != null && FileUtil.pathsEqual(configuration.getFilePath(), file.getVirtualFile().getPath());
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public boolean isConfigurationFromContext(@NotNull GoTestRunConfiguration configuration, ConfigurationContext context) {
PsiElement contextElement = GoRunUtil.getContextElement(context);
if (contextElement == null) return false;
Module module = ModuleUtilCore.findModuleForPsiElement(contextElement);
if (!Comparing.equal(module, configuration.getConfigurationModule().getModule())) return false;
if (!Comparing.equal(myFramework, configuration.getTestFramework())) return false;
PsiFile file = contextElement.getContainingFile();
switch (configuration.getKind()) {
case DIRECTORY:
if (contextElement instanceof PsiDirectory) {
String directoryPath = ((PsiDirectory)contextElement).getVirtualFile().getPath();
return FileUtil.pathsEqual(configuration.getDirectoryPath(), directoryPath) &&
FileUtil.pathsEqual(configuration.getWorkingDirectory(), directoryPath);
}
case PACKAGE:
if (!GoTestFinder.isTestFile(file)) return false;
if (!Comparing.equal(((GoFile)file).getImportPath(false), configuration.getPackage())) return false;
if (GoRunUtil.isPackageContext(contextElement) && configuration.getPattern().isEmpty()) return true;
GoFunctionOrMethodDeclaration contextFunction = findTestFunctionInContext(contextElement);
return contextFunction != null && myFramework.isAvailableOnFunction(contextFunction)
? configuration.getPattern().equals("^" + contextFunction.getName() + "$")
: configuration.getPattern().isEmpty();
case FILE:
GoFunctionOrMethodDeclaration contextTestFunction = findTestFunctionInContext(contextElement);
return contextTestFunction == null && GoTestFinder.isTestFile(file) &&
FileUtil.pathsEqual(configuration.getFilePath(), file.getVirtualFile().getPath());
}
return false;
}
代码示例来源:origin: BashSupport/BashSupport
@Override
public boolean isConfigurationFromContext(BashRunConfiguration configuration, ConfigurationContext context) {
Location location = context.getLocation();
if (location == null) {
return false;
}
//fixme file checks needs to check the properties
VirtualFile file = location.getVirtualFile();
return file != null && FileUtil.pathsEqual(file.getPath(), configuration.getScriptName());
}
}
内容来源于网络,如有侵权,请联系作者删除!