本文整理汇总了Java中com.intellij.util.PathUtil.getCanonicalPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.getCanonicalPath方法的具体用法?Java PathUtil.getCanonicalPath怎么用?Java PathUtil.getCanonicalPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.PathUtil
的用法示例。
在下文中一共展示了PathUtil.getCanonicalPath方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doBuildChildren
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected List<? extends ExternalSystemNode> doBuildChildren() {
List<ExternalSystemNode> runConfigurationNodes = ContainerUtil.newArrayList();
final AbstractExternalSystemTaskConfigurationType configurationType = ExternalSystemUtil.findConfigurationType(myModuleData.getOwner());
if (configurationType == null) return Collections.emptyList();
Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
RunManager.getInstance(myProject).getConfigurationSettingsList(configurationType));
String directory = PathUtil.getCanonicalPath(myModuleData.getLinkedExternalProjectPath());
for (RunnerAndConfigurationSettings cfg : settings) {
ExternalSystemRunConfiguration externalSystemRunConfiguration = (ExternalSystemRunConfiguration)cfg.getConfiguration();
if (directory.equals(PathUtil.getCanonicalPath(externalSystemRunConfiguration.getSettings().getExternalProjectPath()))) {
runConfigurationNodes.add(new RunConfigurationNode(getExternalProjectsView(), this, cfg));
}
}
return runConfigurationNodes;
}
示例2: getCanonicalFile
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
protected File getCanonicalFile(final String path) {
if (path == null) {
return null;
}
try {
final File file = new File(path);
if (file.isAbsolute()) {
return file.getCanonicalFile();
}
final String baseDir = getContextAntProject().getProjectBasedirPath();
if (baseDir == null) {
return null;
}
return new File(PathUtil.getCanonicalPath(new File(baseDir, path).getPath()));
}
catch (IOException e) {
return null;
}
}
示例3: parseItem
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
@Override
protected DirectoryEntry parseItem(ProjectViewParser parser, ParseContext parseContext) {
String text = parseContext.current().text;
boolean excluded = text.startsWith("-");
text = excluded ? text.substring(1) : text;
text = PathUtil.getCanonicalPath(text);
String error = WorkspacePath.validate(text);
if (error != null) {
parseContext.addError(error);
return null;
}
return new DirectoryEntry(new WorkspacePath(text), !excluded);
}
示例4: toAbsolutePath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private String toAbsolutePath(String genRelativePath) {
if (genRelativePath == null) {
return null;
}
if (genRelativePath.length() == 0) {
return "";
}
String moduleDirPath = AndroidRootUtil.getModuleDirPath(myContext.getModule());
if (moduleDirPath == null) return null;
final String path = PathUtil.getCanonicalPath(new File(moduleDirPath, genRelativePath).getPath());
return path != null ? PathUtil.getLocalPath(path) : null;
}
示例5: getCacheDir
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Override
@Nullable
public File getCacheDir(boolean create) {
final String path = ourSystemPath != null ? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
File lint = new File(path, "lint");
if (create && !lint.exists()) {
lint.mkdirs();
}
return lint;
}
示例6: updateRunConfigurations
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void updateRunConfigurations(MavenProject mavenProject) {
boolean childChanged = false;
Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
RunManager.getInstance(myProject).getConfigurationSettingsList(MavenRunConfigurationType.getInstance()));
for (Iterator<RunConfigurationNode> itr = myChildren.iterator(); itr.hasNext(); ) {
RunConfigurationNode node = itr.next();
if (settings.remove(node.getSettings())) {
node.updateRunConfiguration();
}
else {
itr.remove();
childChanged = true;
}
}
String directory = PathUtil.getCanonicalPath(mavenProject.getDirectory());
int oldSize = myChildren.size();
for (RunnerAndConfigurationSettings cfg : settings) {
MavenRunConfiguration mavenRunConfiguration = (MavenRunConfiguration)cfg.getConfiguration();
if (directory.equals(PathUtil.getCanonicalPath(mavenRunConfiguration.getRunnerParameters().getWorkingDirPath()))) {
myChildren.add(new RunConfigurationNode(this, cfg));
}
}
if (oldSize != myChildren.size()) {
childChanged = true;
sort(myChildren);
}
if (childChanged) {
childrenChanged();
}
}
示例7: parseItem
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
@Override
protected GenfilesPath parseItem(ProjectViewParser parser, ParseContext parseContext) {
String canonicalPath = PathUtil.getCanonicalPath(parseContext.current().text);
List<BlazeValidationError> errors = new ArrayList<>();
if (!GenfilesPath.validate(canonicalPath, errors)) {
parseContext.addErrors(errors);
return null;
}
return new GenfilesPath(canonicalPath);
}
示例8: getCompilerSystemDirectory
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public static File getCompilerSystemDirectory() {
//noinspection HardCodedStringLiteral
final String systemPath = ourSystemPath != null? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
return new File(systemPath, "compiler");
}
示例9: getAbsolutePath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static String getAbsolutePath(String path) {
path = VfsUtil.urlToPath(path);
path = PathUtil.getCanonicalPath(path);
return FileUtil.toSystemIndependentName(path);
}
示例10: localPathForRemoteRoot
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public static String localPathForRemoteRoot(@NotNull String sourcesLocalPath, @NotNull String remoteRoot) {
return
PathUtil.getCanonicalPath(new File(sourcesLocalPath, generateRootFolderNameFor(remoteRoot)).getAbsolutePath());
}
示例11: getThumbnailCacheDir
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static File getThumbnailCacheDir() {
final String path = ourSystemPath != null ? ourSystemPath : (ourSystemPath = PathUtil.getCanonicalPath(PathManager.getSystemPath()));
//noinspection HardCodedStringLiteral
return new File(path, "android-devices" + File.separator + "v3");
}
示例12: getNormalizedPath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private static String getNormalizedPath(@NotNull File settingsFile) {
String canonized = PathUtil.getCanonicalPath(settingsFile.getAbsolutePath());
return canonized == null ? null : FileUtil.toSystemIndependentName(canonized);
}
示例13: Path
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public Path(@NotNull String path) {
path = PathUtil.getCanonicalPath(path);
path = FileUtil.toSystemIndependentName(path);
this.path = path;
}
示例14: createModulePom
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private VirtualFile createModulePom() throws IOException {
VirtualFile baseDir = myVirtualFile.getParent();
String modulePath = PathUtil.getCanonicalPath(baseDir.getPath() + "/" + myText);
VirtualFile moduleDir = VfsUtil.createDirectories(modulePath);
return moduleDir.createChildData(this, MavenConstants.POM_XML);
}