mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
pull up getRelativePath() to VfsUtilCore
This commit is contained in:
@@ -22,7 +22,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.reference.SoftReference;
|
||||
import com.intellij.util.LogicalRoot;
|
||||
@@ -129,6 +129,6 @@ public final class IfsUtil {
|
||||
if (root.equals(file)) {
|
||||
return file.getPath();
|
||||
}
|
||||
return "/" + VfsUtil.getRelativePath(file, root, '/');
|
||||
return "/" + VfsUtilCore.getRelativePath(file, root, '/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.roots.ContentEntry;
|
||||
import com.intellij.openapi.roots.ModuleFileIndex;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -83,7 +84,7 @@ public class ModuleChunkSourcepath extends CompositeGenerator{
|
||||
|
||||
addExcludePatterns(module, root, root, excludedFromModule, true);
|
||||
|
||||
final Include include = new Include(VfsUtil.getRelativePath(root, dirSetRoot, '/'));
|
||||
final Include include = new Include(VfsUtilCore.getRelativePath(root, dirSetRoot, '/'));
|
||||
if (moduleFileIndex.isInTestSourceContent(root)) {
|
||||
testSourcesDirSet.add(include);
|
||||
testSourceRootFiles.add(root);
|
||||
@@ -147,7 +148,7 @@ public class ModuleChunkSourcepath extends CompositeGenerator{
|
||||
}
|
||||
final boolean isIncluded = ModuleRootManager.getInstance(module).getFileIndex().isInContent(dir);
|
||||
if (isIncluded != parentIncluded) {
|
||||
final String relativePath = VfsUtil.getRelativePath(dir, root, '/');
|
||||
final String relativePath = VfsUtilCore.getRelativePath(dir, root, '/');
|
||||
if (isIncluded) {
|
||||
generator.add(new Include(relativePath + "/**"));
|
||||
}
|
||||
|
||||
@@ -63,10 +63,7 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.newvfs.ManagingFS;
|
||||
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
|
||||
@@ -1052,7 +1049,7 @@ public class CompileDriver {
|
||||
}
|
||||
|
||||
private static void writeIndex(final BufferedWriter writer, final VirtualFile root, final VirtualFile file) throws IOException {
|
||||
writer.write(VfsUtil.getRelativePath(file, root, '/'));
|
||||
writer.write(VfsUtilCore.getRelativePath(file, root, '/'));
|
||||
writer.write('\n');
|
||||
|
||||
for (VirtualFile child : file.getChildren()) {
|
||||
|
||||
+2
-1
@@ -56,6 +56,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -724,7 +725,7 @@ public class BackendCompilerWrapper {
|
||||
*/
|
||||
protected static String calcPackagePath(VirtualFile srcFile, VirtualFile sourceRoot, String packagePrefix) {
|
||||
final String prefix = packagePrefix != null && packagePrefix.length() > 0 ? packagePrefix.replace('.', '/') + "/" : "";
|
||||
return prefix + VfsUtil.getRelativePath(srcFile, sourceRoot, '/');
|
||||
return prefix + VfsUtilCore.getRelativePath(srcFile, sourceRoot, '/');
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.util.Chunk;
|
||||
@@ -94,7 +94,7 @@ public class ResourceCompiler implements TranslatingCompiler {
|
||||
continue;
|
||||
}
|
||||
final String sourcePath = file.getPath();
|
||||
final String relativePath = VfsUtil.getRelativePath(file, fileRoot, '/');
|
||||
final String relativePath = VfsUtilCore.getRelativePath(file, fileRoot, '/');
|
||||
final boolean inTests = ((CompileContextEx)context).isInTestSourceContent(file);
|
||||
final VirtualFile outputDir = inTests? context.getModuleOutputDirectoryForTests(module) : context.getModuleOutputDirectory(module);
|
||||
if (outputDir == null) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactManager;
|
||||
@@ -336,7 +337,7 @@ public class ArtifactUtil {
|
||||
relativePath = ((FileCopyPackagingElement)element).getOutputFileName();
|
||||
}
|
||||
else {
|
||||
relativePath = VfsUtil.getRelativePath(file, root, '/');
|
||||
relativePath = VfsUtilCore.getRelativePath(file, root, '/');
|
||||
}
|
||||
artifacts.add(Trinity.create(artifact, path, relativePath));
|
||||
return false;
|
||||
@@ -361,7 +362,7 @@ public class ArtifactUtil {
|
||||
@NotNull PackagingElementResolvingContext context) {
|
||||
for (VirtualFile sourceRoot : moduleElement.getSourceRoots(context)) {
|
||||
if (VfsUtil.isAncestor(sourceRoot, file, true)) {
|
||||
return VfsUtil.getRelativePath(file, sourceRoot, '/');
|
||||
return VfsUtilCore.getRelativePath(file, sourceRoot, '/');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.FieldPanel;
|
||||
@@ -417,7 +417,7 @@ public class SourcePathsStep extends AbstractStepWithProgress<List<Trinity<Strin
|
||||
final String fullPath = myField.getText().trim().replace(File.separatorChar, '/');
|
||||
final VirtualFile fileByPath = LocalFileSystem.getInstance().findFileByPath(fullPath);
|
||||
LOG.assertTrue(fileByPath != null);
|
||||
myField.setText(VfsUtil.getRelativePath(fileByPath, contentEntryDir, File.separatorChar));
|
||||
myField.setText(VfsUtilCore.getRelativePath(fileByPath, contentEntryDir, File.separatorChar));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.TitlePanel;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
@@ -108,7 +108,7 @@ public class DetectedRootsChooserDialog extends DialogWrapper {
|
||||
if (leaf) {
|
||||
VirtualFile ancestor = (VirtualFile)((CheckedTreeNode)node.getParent()).getUserObject();
|
||||
if (ancestor != null) {
|
||||
text = VfsUtil.getRelativePath(file, ancestor, File.separatorChar);
|
||||
text = VfsUtilCore.getRelativePath(file, ancestor, File.separatorChar);
|
||||
}
|
||||
else {
|
||||
text = file.getPresentableUrl();
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.roots.impl.DirectoryIndex;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NotNullLazyKey;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.*;
|
||||
@@ -434,7 +434,7 @@ public abstract class PsiJavaFileBaseImpl extends PsiFileImpl implements PsiJava
|
||||
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
|
||||
final VirtualFile sourceRoot = index.getSourceRootForFile(virtualFile);
|
||||
if (sourceRoot != null && folder != null) {
|
||||
String relativePath = VfsUtil.getRelativePath(folder, sourceRoot, '/');
|
||||
String relativePath = VfsUtilCore.getRelativePath(folder, sourceRoot, '/');
|
||||
LOG.assertTrue(relativePath != null);
|
||||
List<OrderEntry> orderEntries = index.getOrderEntriesForFile(virtualFile);
|
||||
if (orderEntries.isEmpty()) {
|
||||
|
||||
@@ -124,9 +124,9 @@ public class VfsUtilTest extends IdeaTestCase {
|
||||
final VirtualFile vSubSubDir = LocalFileSystem.getInstance().findFileByIoFile(subSubDir);
|
||||
assertNotNull(vSubSubDir);
|
||||
|
||||
assertEquals("subDir", VfsUtil.getRelativePath(vSubDir, vTestRoot, '/'));
|
||||
assertEquals("subDir/subSubDir", VfsUtil.getRelativePath(vSubSubDir, vTestRoot, '/'));
|
||||
assertEquals("", VfsUtil.getRelativePath(vTestRoot, vTestRoot, '/'));
|
||||
assertEquals("subDir", VfsUtilCore.getRelativePath(vSubDir, vTestRoot, '/'));
|
||||
assertEquals("subDir/subSubDir", VfsUtilCore.getRelativePath(vSubSubDir, vTestRoot, '/'));
|
||||
assertEquals("", VfsUtilCore.getRelativePath(vTestRoot, vTestRoot, '/'));
|
||||
}
|
||||
|
||||
public void testAsyncRefresh() throws Throwable {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.vfs;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class VfsUtilCore {
|
||||
/**
|
||||
@@ -37,4 +38,46 @@ public class VfsUtilCore {
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the relative path of <code>file</code> to its <code>ancestor</code>. Uses <code>separator</code> for
|
||||
* separating files.
|
||||
*
|
||||
* @param file the file
|
||||
* @param ancestor parent file
|
||||
* @param separator character to use as files separator
|
||||
* @return the relative path or {@code null} if {@code ancestor} is not ancestor for {@code file}
|
||||
*/
|
||||
@Nullable
|
||||
public static String getRelativePath(@NotNull VirtualFile file, @NotNull VirtualFile ancestor, char separator) {
|
||||
if (!file.getFileSystem().equals(ancestor.getFileSystem())) return null;
|
||||
|
||||
int length = 0;
|
||||
VirtualFile parent = file;
|
||||
while (true) {
|
||||
if (parent == null) return null;
|
||||
if (parent.equals(ancestor)) break;
|
||||
if (length > 0) {
|
||||
length++;
|
||||
}
|
||||
length += parent.getName().length();
|
||||
parent = parent.getParent();
|
||||
}
|
||||
|
||||
char[] chars = new char[length];
|
||||
int index = chars.length;
|
||||
parent = file;
|
||||
while (true) {
|
||||
if (parent.equals(ancestor)) break;
|
||||
if (index < length) {
|
||||
chars[--index] = separator;
|
||||
}
|
||||
String name = parent.getName();
|
||||
for (int i = name.length() - 1; i >= 0; i--) {
|
||||
chars[--index] = name.charAt(i);
|
||||
}
|
||||
parent = parent.getParent();
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-5
@@ -26,10 +26,7 @@ import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.ui.LightFilePointer;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
@@ -179,7 +176,7 @@ public class OrderEntryCellAppearanceUtils {
|
||||
relativePath = absolutePath.startsWith(contentPath) ? absolutePath.substring(contentPath.length()) : absolutePath;
|
||||
}
|
||||
else {
|
||||
relativePath = VfsUtil.getRelativePath(folderFile.getFile(), file, File.separatorChar);
|
||||
relativePath = VfsUtilCore.getRelativePath(folderFile.getFile(), file, File.separatorChar);
|
||||
textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
|
||||
}
|
||||
if (relativePath == null) relativePath = "";
|
||||
|
||||
+3
-2
@@ -29,6 +29,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -188,13 +189,13 @@ public class FilePatternPackageSet extends PatternBasedPackageSet {
|
||||
VirtualFile projectBaseDir) {
|
||||
final VirtualFile contentRootForFile = index.getContentRootForFile(virtualFile);
|
||||
if (contentRootForFile != null) {
|
||||
return VfsUtil.getRelativePath(virtualFile, contentRootForFile, '/');
|
||||
return VfsUtilCore.getRelativePath(virtualFile, contentRootForFile, '/');
|
||||
}
|
||||
final Module module = index.getModuleForFile(virtualFile);
|
||||
if (module != null) {
|
||||
if (projectBaseDir != null) {
|
||||
if (VfsUtil.isAncestor(projectBaseDir, virtualFile, false)){
|
||||
final String projectRelativePath = VfsUtil.getRelativePath(virtualFile, projectBaseDir, '/');
|
||||
final String projectRelativePath = VfsUtilCore.getRelativePath(virtualFile, projectBaseDir, '/');
|
||||
return useFQName ? projectRelativePath : projectRelativePath.substring(projectRelativePath.indexOf('/') + 1);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import com.intellij.openapi.editor.HectorComponentPanel;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.include.FileIncludeManager;
|
||||
@@ -105,7 +105,7 @@ public class FileIncludeContextHectorPanel extends HectorComponentPanel {
|
||||
root = fileIndex.getContentRootForFile(file);
|
||||
}
|
||||
if (root != null) {
|
||||
return VfsUtil.getRelativePath(file, root, '/');
|
||||
return VfsUtilCore.getRelativePath(file, root, '/');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ import com.intellij.framework.detection.DetectedFrameworkDescription;
|
||||
import com.intellij.framework.detection.DetectionExcludesConfiguration;
|
||||
import com.intellij.framework.detection.FrameworkDetectionContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.ColoredTreeCellRenderer;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
@@ -97,7 +97,7 @@ class DetectedFrameworkNode extends DetectedFrameworkTreeNodeBase {
|
||||
private String getRelativePath(@NotNull VirtualFile file) {
|
||||
final VirtualFile dir = myContext.getBaseDir();
|
||||
if (dir != null) {
|
||||
final String path = VfsUtil.getRelativePath(dir, file, File.separatorChar);
|
||||
final String path = VfsUtilCore.getRelativePath(dir, file, File.separatorChar);
|
||||
if (path != null) {
|
||||
return path;
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ package com.intellij.framework.detection.impl.ui;
|
||||
|
||||
import com.intellij.framework.detection.DetectionExcludesConfiguration;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.ColoredTreeCellRenderer;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
@@ -48,7 +48,7 @@ class FrameworkDirectoryNode extends DetectedFrameworkTreeNodeBase {
|
||||
String path;
|
||||
if (parent instanceof FrameworkDirectoryNode) {
|
||||
final VirtualFile parentDir = ((FrameworkDirectoryNode)parent).myDirectory;
|
||||
path = VfsUtil.getRelativePath(myDirectory, parentDir, File.separatorChar);
|
||||
path = VfsUtilCore.getRelativePath(myDirectory, parentDir, File.separatorChar);
|
||||
LOG.assertTrue(path != null, myDirectory + " is not under " + parentDir);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -61,7 +62,7 @@ public class PatchProjectUtil {
|
||||
final Set<VirtualFile> included = new HashSet<VirtualFile>();
|
||||
iterate(contentRoot, new ContentIterator() {
|
||||
public boolean processFile(final VirtualFile fileOrDir) {
|
||||
String relativeName = VfsUtil.getRelativePath(fileOrDir, contentRoot, '/');
|
||||
String relativeName = VfsUtilCore.getRelativePath(fileOrDir, contentRoot, '/');
|
||||
for (Pattern module : excludePatterns.keySet()) {
|
||||
if (module == null || module.matcher(modules[idx].getName()).matches()) {
|
||||
final Set<Pattern> dirPatterns = excludePatterns.get(module);
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.ui.HoverHyperlinkLabel;
|
||||
@@ -215,7 +216,7 @@ public abstract class ContentRootPanel extends JPanel {
|
||||
final VirtualFile contentEntryFile = getContentEntry().getFile();
|
||||
final String packagePrefix = folder instanceof SourceFolder? ((SourceFolder)folder).getPackagePrefix() : "";
|
||||
if (folderFile != null && contentEntryFile != null) {
|
||||
String path = folderFile.equals(contentEntryFile)? "." :VfsUtil.getRelativePath(folderFile, contentEntryFile, File.separatorChar);
|
||||
String path = folderFile.equals(contentEntryFile)? "." : VfsUtilCore.getRelativePath(folderFile, contentEntryFile, File.separatorChar);
|
||||
if (packagePrefix.length() > 0) {
|
||||
path = path + " (" + packagePrefix + ")";
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.changes.ContentRevision;
|
||||
import com.intellij.openapi.vcs.changes.patch.RelativePathCalculator;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ModuleVcsPathPresenter extends VcsPathPresenter {
|
||||
result.append(module.getName());
|
||||
result.append("] ");
|
||||
result.append(contentRoot.getName());
|
||||
String relativePath = VfsUtil.getRelativePath(file, contentRoot, File.separatorChar);
|
||||
String relativePath = VfsUtilCore.getRelativePath(file, contentRoot, File.separatorChar);
|
||||
if (relativePath.length() > 0) {
|
||||
result.append(File.separatorChar);
|
||||
result.append(relativePath);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -66,13 +67,13 @@ public class DirectoryNode extends PackageDependenciesNode {
|
||||
else {
|
||||
final VirtualFile sourceRoot = index.getSourceRootForFile(myVDirectory);
|
||||
if (myVDirectory == sourceRoot) {
|
||||
myFQName = VfsUtil.getRelativePath(myVDirectory, contentRoot, '/');
|
||||
myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
|
||||
}
|
||||
else if (sourceRoot != null) {
|
||||
myFQName = VfsUtil.getRelativePath(myVDirectory, sourceRoot, '/');
|
||||
myFQName = VfsUtilCore.getRelativePath(myVDirectory, sourceRoot, '/');
|
||||
}
|
||||
else {
|
||||
myFQName = VfsUtil.getRelativePath(myVDirectory, contentRoot, '/');
|
||||
myFQName = VfsUtilCore.getRelativePath(myVDirectory, contentRoot, '/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ public class DirectoryNode extends PackageDependenciesNode {
|
||||
if (baseDir != null) {
|
||||
if (myVDirectory != baseDir) {
|
||||
if (VfsUtil.isAncestor(baseDir, myVDirectory, false)) {
|
||||
return VfsUtil.getRelativePath(myVDirectory, baseDir, '/');
|
||||
return VfsUtilCore.getRelativePath(myVDirectory, baseDir, '/');
|
||||
} else {
|
||||
return myVDirectory.getPresentableUrl();
|
||||
}
|
||||
@@ -145,7 +146,7 @@ public class DirectoryNode extends PackageDependenciesNode {
|
||||
if (contentRoot == null) {
|
||||
return "";
|
||||
}
|
||||
return VfsUtil.getRelativePath(directory, contentRoot, '/');
|
||||
return VfsUtilCore.getRelativePath(directory, contentRoot, '/');
|
||||
}
|
||||
|
||||
public PsiElement getPsiElement() {
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packageDependencies.DependencyUISettings;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -109,7 +109,7 @@ public class ProjectPatternProvider extends PatternDialectProvider {
|
||||
LOG.assertTrue(virtualFile != null);
|
||||
final VirtualFile contentRoot = ProjectRootManager.getInstance(file.getProject()).getFileIndex().getContentRootForFile(virtualFile);
|
||||
if (contentRoot == null) return null;
|
||||
final String fqName = VfsUtil.getRelativePath(virtualFile, contentRoot, '/');
|
||||
final String fqName = VfsUtilCore.getRelativePath(virtualFile, contentRoot, '/');
|
||||
if (fqName != null) return new FilePatternPackageSet(getModulePattern(node), fqName);
|
||||
}
|
||||
return null;
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import com.intellij.openapi.vfs.newvfs.NewVirtualFileSystem;
|
||||
@@ -458,7 +459,7 @@ public class FileReference implements FileReferenceOwner, PsiPolyVariantReferenc
|
||||
final VirtualFile contextFile = context.getVirtualFile();
|
||||
assert contextFile != null;
|
||||
if (VfsUtil.isAncestor(contextFile, dstVFile, true)) {
|
||||
final String path = VfsUtil.getRelativePath(dstVFile, contextFile, '/');
|
||||
final String path = VfsUtilCore.getRelativePath(dstVFile, contextFile, '/');
|
||||
if (path != null) {
|
||||
return rename(path);
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ import com.intellij.openapi.module.ModuleUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.roots.impl.DirectoryIndex;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -69,7 +69,7 @@ public class PsiFileReferenceHelper extends FileReferenceHelper {
|
||||
assert parentFile != null;
|
||||
VirtualFile root = index.getSourceRootForFile(parentFile);
|
||||
if (root != null) {
|
||||
String path = VfsUtil.getRelativePath(parentFile, root, '.');
|
||||
String path = VfsUtilCore.getRelativePath(parentFile, root, '.');
|
||||
|
||||
if (path != null) {
|
||||
final Module module = ModuleUtil.findModuleForFile(file, project);
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ import com.intellij.CommonBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -207,7 +207,7 @@ public class MoveDirectoryWithClassesProcessor extends BaseRefactoringProcessor
|
||||
PsiDirectory rootDirectory,
|
||||
@NotNull TargetDirectoryWrapper targetDirectory) {
|
||||
final PsiElement[] children = directory.getChildren();
|
||||
final String relativePath = VfsUtil.getRelativePath(directory.getVirtualFile(), rootDirectory.getVirtualFile(), '/');
|
||||
final String relativePath = VfsUtilCore.getRelativePath(directory.getVirtualFile(), rootDirectory.getVirtualFile(), '/');
|
||||
|
||||
final TargetDirectoryWrapper newTargetDirectory = relativePath.length() == 0
|
||||
? targetDirectory
|
||||
|
||||
@@ -60,48 +60,6 @@ public class VfsUtil extends VfsUtilCore {
|
||||
file.setBinaryContent(text.getBytes(charset.name()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the relative path of <code>file</code> to its <code>ancestor</code>. Uses <code>separator</code> for
|
||||
* separating files.
|
||||
*
|
||||
* @param file the file
|
||||
* @param ancestor parent file
|
||||
* @param separator character to use as files separator
|
||||
* @return the relative path or {@code null} if {@code ancestor} is not ancestor for {@code file}
|
||||
*/
|
||||
@Nullable
|
||||
public static String getRelativePath(@NotNull VirtualFile file, @NotNull VirtualFile ancestor, char separator) {
|
||||
if (!file.getFileSystem().equals(ancestor.getFileSystem())) return null;
|
||||
|
||||
int length = 0;
|
||||
VirtualFile parent = file;
|
||||
while (true) {
|
||||
if (parent == null) return null;
|
||||
if (parent.equals(ancestor)) break;
|
||||
if (length > 0) {
|
||||
length++;
|
||||
}
|
||||
length += parent.getName().length();
|
||||
parent = parent.getParent();
|
||||
}
|
||||
|
||||
char[] chars = new char[length];
|
||||
int index = chars.length;
|
||||
parent = file;
|
||||
while (true) {
|
||||
if (parent.equals(ancestor)) break;
|
||||
if (index < length) {
|
||||
chars[--index] = separator;
|
||||
}
|
||||
String name = parent.getName();
|
||||
for (int i = name.length() - 1; i >= 0; i--) {
|
||||
chars[--index] = name.charAt(i);
|
||||
}
|
||||
parent = parent.getParent();
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies all files matching the <code>filter</code> from <code>fromDir</code> to <code>toDir</code>.
|
||||
*
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
@@ -136,7 +137,7 @@ public class EmptyDirectoryInspection extends BaseGlobalInspection {
|
||||
});
|
||||
for (VirtualFile otherRoot : contentRoots) {
|
||||
if (VfsUtil.isAncestor(otherRoot, file, false)) {
|
||||
return VfsUtil.getRelativePath(file, otherRoot, '/');
|
||||
return VfsUtilCore.getRelativePath(file, otherRoot, '/');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import org.jetbrains.android.facet.AndroidFacet;
|
||||
@@ -51,7 +51,7 @@ public class AndroidIncludingCompiler implements SourceGeneratingCompiler {
|
||||
@Nullable
|
||||
@Override
|
||||
public VirtualFile getPresentableFile(CompileContext context, Module module, VirtualFile outputRoot, VirtualFile generatedFile) {
|
||||
String generatedFileRelativePath = VfsUtil.getRelativePath(generatedFile, outputRoot, '/');
|
||||
String generatedFileRelativePath = VfsUtilCore.getRelativePath(generatedFile, outputRoot, '/');
|
||||
if (generatedFileRelativePath == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class AndroidIncludingCompiler implements SourceGeneratingCompiler {
|
||||
return true;
|
||||
}
|
||||
if (fileOrDir.getFileType() == StdFileTypes.JAVA) {
|
||||
String relativePath = VfsUtil.getRelativePath(fileOrDir, sourceRoot, '/');
|
||||
String relativePath = VfsUtilCore.getRelativePath(fileOrDir, sourceRoot, '/');
|
||||
LOG.assertTrue(relativePath != null);
|
||||
MyItem existingItem = relativePath2GenItem.get(relativePath);
|
||||
if (existingItem != null) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.intellij.openapi.compiler.CompilerMessageCategory;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
@@ -321,7 +321,7 @@ public class AndroidApkBuilder {
|
||||
ArrayList<VirtualFile> list = new ArrayList<VirtualFile>();
|
||||
collectNativeLibraries(child, list, debugBuild);
|
||||
for (VirtualFile file : list) {
|
||||
String relativePath = VfsUtil.getRelativePath(file, nativeLibsFolder, File.separatorChar);
|
||||
String relativePath = VfsUtilCore.getRelativePath(file, nativeLibsFolder, File.separatorChar);
|
||||
String path = FileUtil.toSystemIndependentName(SdkConstants.FD_APK_NATIVE_LIBS + File.separator + relativePath);
|
||||
if (added.add(path)) {
|
||||
builder.writeFile(toIoFile(file), path);
|
||||
@@ -387,7 +387,7 @@ public class AndroidApkBuilder {
|
||||
SignedJarBuilder jarBuilder,
|
||||
Set<String> added) throws IOException {
|
||||
for (VirtualFile child : resources) {
|
||||
final String relativePath = FileUtil.toSystemIndependentName(VfsUtil.getRelativePath(child, sourceRoot, File.separatorChar));
|
||||
final String relativePath = FileUtil.toSystemIndependentName(VfsUtilCore.getRelativePath(child, sourceRoot, File.separatorChar));
|
||||
if (!added.contains(relativePath)) {
|
||||
File file = toIoFile(child);
|
||||
jarBuilder.writeFile(file, FileUtil.toSystemIndependentName(relativePath));
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.android.facet.AndroidFacet;
|
||||
import org.jetbrains.android.facet.AndroidFacetConfiguration;
|
||||
@@ -117,7 +118,7 @@ public class AndroidMavenProviderImpl implements AndroidMavenProvider {
|
||||
ResourceProcessor processor) {
|
||||
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
|
||||
if (!fileIndex.isIgnored(file)) {
|
||||
String relPath = VfsUtil.getRelativePath(file, sourceRoot, '/');
|
||||
String relPath = VfsUtilCore.getRelativePath(file, sourceRoot, '/');
|
||||
if (relPath != null && MavenUtil.isIncluded(relPath, includes, excludes)) {
|
||||
if (processor.process(file, resOutputDir + "/" + relPath)) {
|
||||
return true;
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.MultiLineLabelUI;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
@@ -188,7 +189,7 @@ public class ChooseModulesDialog extends DialogWrapper {
|
||||
assert virtualFile != null;
|
||||
final VirtualFile projectPath = myProject.getBaseDir();
|
||||
if (VfsUtil.isAncestor(projectPath, virtualFile, false)) {
|
||||
append(" (" + VfsUtil.getRelativePath(virtualFile, projectPath, File.separatorChar) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
append(" (" + VfsUtilCore.getRelativePath(virtualFile, projectPath, File.separatorChar) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
} else {
|
||||
append(" (" + virtualFile.getPresentableUrl() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,7 @@ import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.ex.http.HttpFileSystem;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -165,7 +162,7 @@ public class EJavadocUtil {
|
||||
if (javadocFile != null) {
|
||||
final String relativeUrl;
|
||||
if (contentRoot != null && VfsUtil.isAncestor(contentRoot, javadocFile, false)) {
|
||||
relativeUrl = "/" + VfsUtil.getRelativePath(javadocFile, baseDir, '/');
|
||||
relativeUrl = "/" + VfsUtilCore.getRelativePath(javadocFile, baseDir, '/');
|
||||
} else {
|
||||
relativeUrl = collapse2eclipseRelative2OtherModule(project, javadocFile);
|
||||
}
|
||||
|
||||
@@ -31,10 +31,7 @@ import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.roots.impl.ProjectRootManagerImpl;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.idea.eclipse.EclipseXml;
|
||||
@@ -192,7 +189,7 @@ public class EPathUtil {
|
||||
final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots();
|
||||
for (VirtualFile otherRoot : contentRoots) {
|
||||
if (VfsUtil.isAncestor(otherRoot, file, false)) {
|
||||
return "/" + module.getName() + "/" + VfsUtil.getRelativePath(file, otherRoot, '/');
|
||||
return "/" + module.getName() + "/" + VfsUtilCore.getRelativePath(file, otherRoot, '/');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -220,7 +217,7 @@ public class EPathUtil {
|
||||
}
|
||||
LOG.assertTrue(file != null, url);
|
||||
if (contentRoot != null && VfsUtil.isAncestor(contentRoot, file, false)) { //inside current project
|
||||
return VfsUtil.getRelativePath(file, contentRoot, '/');
|
||||
return VfsUtilCore.getRelativePath(file, contentRoot, '/');
|
||||
} else {
|
||||
final String path = collapse2eclipseRelative2OtherModule(project, file); //relative to other project
|
||||
if (path != null) {
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class GroovyMoveScriptTest extends LightCodeInsightFixtureTestCase {
|
||||
String testName = getTestName(true);
|
||||
final VirtualFile actualRoot = myFixture.copyDirectoryToProject(testName + "/before", "");
|
||||
|
||||
performAction(fileNames, newDirName, VfsUtil.getRelativePath(actualRoot, myFixture.getTempDirFixture().getFile(""), '/'));
|
||||
performAction(fileNames, newDirName, VfsUtilCore.getRelativePath(actualRoot, myFixture.getTempDirFixture().getFile(""), '/'));
|
||||
|
||||
final VirtualFile expectedRoot = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + getTestName(true) + "/after");
|
||||
//File expectedRoot = new File(getTestDataPath() + testName + "/after");
|
||||
|
||||
+2
-1
@@ -34,6 +34,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.text.CaseInsensitiveStringHashingStrategy;
|
||||
@@ -308,7 +309,7 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler {
|
||||
indicator);
|
||||
}
|
||||
else {
|
||||
String relPath = VfsUtil.getRelativePath(eachSourceFile, sourceRoot, '/');
|
||||
String relPath = VfsUtilCore.getRelativePath(eachSourceFile, sourceRoot, '/');
|
||||
if (fileIndex.isIgnored(eachSourceFile)) continue;
|
||||
if (!MavenUtil.isIncluded(relPath, includes, excludes)) continue;
|
||||
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ package org.jetbrains.idea.maven.wizards;
|
||||
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
|
||||
import com.intellij.ide.util.projectWizard.ProjectWizardStepFactory;
|
||||
import com.intellij.ide.util.projectWizard.WizardContext;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.projectImport.ProjectImportProvider;
|
||||
import com.intellij.projectImport.SelectImportedProjectsStep;
|
||||
@@ -45,7 +45,7 @@ public class MavenProjectImportProvider extends ProjectImportProvider {
|
||||
stringBuilder.append(project.getMavenId());
|
||||
VirtualFile root = ((MavenProjectBuilder)getBuilder()).getRootDirectory();
|
||||
if (root != null) {
|
||||
final String relPath = VfsUtil.getRelativePath(project.getDirectoryFile(), root, File.separatorChar);
|
||||
final String relPath = VfsUtilCore.getRelativePath(project.getDirectoryFile(), root, File.separatorChar);
|
||||
if (relPath.length() != 0) {
|
||||
stringBuilder.append(" [").append(relPath).append("]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user