本文整理汇总了Java中com.intellij.openapi.util.io.FileUtil.pathsEqual方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.pathsEqual方法的具体用法?Java FileUtil.pathsEqual怎么用?Java FileUtil.pathsEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.io.FileUtil
的用法示例。
在下文中一共展示了FileUtil.pathsEqual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSameProject
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private static boolean isSameProject(String path, @NotNull Project project) {
IProjectStore projectStore = (IProjectStore)ServiceKt.getStateStore(project);
String toOpen = FileUtil.toSystemIndependentName(path);
String existing = projectStore.getProjectFilePath();
String existingBaseDir = projectStore.getProjectBasePath();
if (existingBaseDir == null) {
// could be null if not yet initialized
return false;
}
final File openFile = new File(toOpen);
if (openFile.isDirectory()) {
return FileUtil.pathsEqual(toOpen, existingBaseDir);
}
if (StorageScheme.DIRECTORY_BASED == projectStore.getStorageScheme()) {
// todo: check if IPR is located not under the project base dir
return FileUtil.pathsEqual(FileUtil.toSystemIndependentName(openFile.getParentFile().getPath()), existingBaseDir);
}
return FileUtil.pathsEqual(toOpen, existing);
}
示例2: addMapping
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
public static List<VcsDirectoryMapping> addMapping(@NotNull List<VcsDirectoryMapping> existingMappings,
@NotNull String path,
@NotNull String vcs) {
List<VcsDirectoryMapping> mappings = new ArrayList<VcsDirectoryMapping>(existingMappings);
for (Iterator<VcsDirectoryMapping> iterator = mappings.iterator(); iterator.hasNext(); ) {
VcsDirectoryMapping mapping = iterator.next();
if (mapping.isDefaultMapping() && StringUtil.isEmptyOrSpaces(mapping.getVcs())) {
LOG.debug("Removing <Project> -> <None> mapping");
iterator.remove();
}
else if (FileUtil.pathsEqual(mapping.getDirectory(), path)) {
if (!StringUtil.isEmptyOrSpaces(mapping.getVcs())) {
LOG.warn("Substituting existing mapping [" + path + "] -> [" + mapping.getVcs() + "] with [" + vcs + "]");
}
else {
LOG.debug("Removing [" + path + "] -> <None> mapping");
}
iterator.remove();
}
}
mappings.add(new VcsDirectoryMapping(path, vcs));
return mappings;
}
示例3: isExcludedFromCompilation
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public boolean isExcludedFromCompilation(@NotNull JpsModule module, @NotNull JpsModuleSourceRoot root) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(module);
if (extension == null) {
return false;
}
try {
for (String genDir : AndroidJpsUtil.getGenDirs(extension)) {
if (FileUtil.pathsEqual(genDir, root.getFile().getPath())) {
return true;
}
}
}
catch (IOException e) {
LOG.info(e);
}
return false;
}
示例4: writeFile
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public void writeFile(File inputFile, String jarPath) throws IOException {
if (FileUtil.pathsEqual(inputFile.getPath(), myOutFilePath)) {
throw new IOException("Cannot pack file " + myOutFilePath + " into itself");
}
super.writeFile(inputFile, jarPath);
}
示例5: isManagedFile
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public boolean isManagedFile(String path) {
synchronized (myStateLock) {
for (String each : myManagedFilesPaths) {
if (FileUtil.pathsEqual(each, path)) return true;
}
return false;
}
}
示例6: findByPath
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Nullable
private static Sdk findByPath(@NotNull SdkType sdkType, @NotNull Sdk[] sdks, @NotNull String sdkHome) {
for (Sdk sdk : sdks) {
final String path = sdk.getHomePath();
if (sdk.getSdkType() == sdkType && path != null &&
FileUtil.pathsEqual(FileUtil.toSystemIndependentName(path), FileUtil.toSystemIndependentName(sdkHome))) {
return sdk;
}
}
return null;
}
示例7: setSdkHome
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public void setSdkHome(String sdkHome) {
List<Sdk> sdkList = new ArrayList<Sdk>();
sdkList.add(null);
final List<Sdk> allSdks = PythonSdkType.getAllSdks();
Collections.sort(allSdks, new PreferredSdkComparator());
Sdk selection = null;
for (Sdk sdk : allSdks) {
String homePath = sdk.getHomePath();
if (homePath != null && sdkHome != null && FileUtil.pathsEqual(homePath, sdkHome)) selection = sdk;
sdkList.add(sdk);
}
myInterpreterComboBox.setModel(new CollectionComboBoxModel(sdkList, selection));
}
示例8: isPotentialProject
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public boolean isPotentialProject(String path) {
if (isManagedFile(path)) return true;
for (MavenProject each : getProjects()) {
if (FileUtil.pathsEqual(path, each.getPath())) return true;
if (each.getModulePaths().contains(path)) return true;
}
return false;
}
示例9: findSdkByPath
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Nullable
public static Sdk findSdkByPath(List<Sdk> sdkList, @Nullable String path) {
if (path != null) {
for (Sdk sdk : sdkList) {
if (sdk != null && FileUtil.pathsEqual(path, sdk.getHomePath())) {
return sdk;
}
}
}
return null;
}
示例10: checkUnambiguousAndRecursiveArtifacts
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private static boolean checkUnambiguousAndRecursiveArtifacts(CompileContext context, List<JpsArtifact> artifacts) {
boolean success = true;
for (JpsArtifact artifact : artifacts) {
if (artifact.getArtifactType() instanceof AndroidApplicationArtifactType) {
final List<JpsAndroidModuleExtension> facets = AndroidJpsUtil.getAllPackagedFacets(artifact);
if (facets.size() > 1) {
context.processMessage(new CompilerMessage(
ANDROID_VALIDATOR, BuildMessage.Kind.ERROR, "Cannot build artifact '" + artifact.getName() +
"' because it contains more than one Android package"));
success = false;
continue;
}
final String artifactOutputPath = artifact.getOutputFilePath();
if (artifactOutputPath != null && facets.size() > 0) {
final JpsAndroidModuleExtension facet = facets.get(0);
final String apkPath = AndroidFinalPackageElementBuilder.getApkPath(facet);
if (FileUtil.pathsEqual(apkPath, artifactOutputPath)) {
context.processMessage(new CompilerMessage(
ANDROID_VALIDATOR, BuildMessage.Kind.ERROR,
"Incorrect output path for artifact '" + artifact.getName() + "': " + FileUtil.toSystemDependentName(apkPath)));
success = false;
}
}
}
}
return success;
}
示例11: registerPathVariable
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private static void registerPathVariable() {
String repository = MavenUtil.resolveLocalRepository(null, null, null).getAbsolutePath();
PathMacros macros = PathMacros.getInstance();
for (String each : macros.getAllMacroNames()) {
String path = macros.getValue(each);
if (path != null && FileUtil.pathsEqual(repository, path)) {
return;
}
}
macros.setMacro(MAVEN_REPOSITORY, repository);
}
示例12: isRunningTarget
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public boolean isRunningTarget(AntBuildTarget target) {
final VirtualFile vFile = target.getModel().getBuildFile().getVirtualFile();
if (vFile == null) {
return false;
}
if (myAntFileUrl == null || !FileUtil.pathsEqual(myAntFileUrl, vFile.getUrl())) {
return false;
}
return Comparing.equal(myTargetName, target.getName());
}
示例13: isEqual
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public boolean isEqual(String val1, String val2) {
return FileUtil.pathsEqual(val1, val2);
}
示例14: isConfigurationFromContext
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public boolean isConfigurationFromContext(JarApplicationConfiguration configuration, ConfigurationContext context) {
VirtualFile file = getJarFileFromContext(context);
return file != null && FileUtil.pathsEqual(file.getPath(), configuration.getJarPath());
}
示例15: belongs
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public boolean belongs(String url) {
if (myFile.isDirectory()){
return FileUtil.startsWith(url, myUrl);
}
return FileUtil.pathsEqual(url, myUrl);
}