本文整理汇总了Java中com.intellij.util.PathUtil.toSystemIndependentName方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.toSystemIndependentName方法的具体用法?Java PathUtil.toSystemIndependentName怎么用?Java PathUtil.toSystemIndependentName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.PathUtil
的用法示例。
在下文中一共展示了PathUtil.toSystemIndependentName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSdkDownloadUrl
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
/**
* @return Android SDK download URL
*/
@NotNull
public static String getSdkDownloadUrl() {
String url = System.getProperty("android.sdkurl");
if (!StringUtil.isEmptyOrSpaces(url)) {
File file = new File(url);
if (file.isFile()) {
// Can't use any path => URL utilities as they don't add two slashes
// after the protocol as required by IJ downloader
return LocalFileSystem.PROTOCOL_PREFIX + PathUtil.toSystemIndependentName(file.getAbsolutePath());
}
else {
System.err.println("File " + file.getAbsolutePath() + " does not exist.");
}
}
String downloadUrl = AndroidSdkUtils.getSdkDownloadUrl();
if (downloadUrl == null) {
throw new IllegalStateException("Unsupported OS");
}
return downloadUrl;
}
示例2: createProjectWithSubprojects
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
private VirtualFile createProjectWithSubprojects(Map<String, String> modules, String... nonExistingReferencedModules) throws IOException {
Collection<String> customLocationStatements = new LinkedList<String>();
for (Map.Entry<String, String> module : modules.entrySet()) {
String path = module.getValue();
if (Strings.isNullOrEmpty(path)) {
path = PathUtil.toSystemIndependentName(GradleUtil.getDefaultPhysicalPathFromGradlePath(module.getKey()));
}
else {
customLocationStatements.add(String.format("project('%s').projectDir = new File('%s')", module.getKey(), path));
}
createGradleProjectToImport(dir, path);
}
Iterable<String> allModules =
Iterables.concat(modules.keySet(), Iterables.transform(Arrays.asList(nonExistingReferencedModules), pathToModuleName));
return configureTopLevelProject(dir, allModules, customLocationStatements);
}
示例3: getFilePath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
public final String getFilePath() {
String chosenExtension = this.getExtension();
String filename = PathUtil.toSystemIndependentName(this.getFileName());
String extension = PhpNameUtil.getExtension(filename);
String fullFileName = chosenExtension.equals(extension)?filename:PhpNameUtil.getFullFileName(filename, chosenExtension);
String relativePath = this.myDirectoryCombobox.getRelativePath();
return StringUtil.isEmpty(relativePath)?fullFileName:relativePath + "/" + StringUtil.trimEnd(fullFileName, "/");
}
示例4: getStatus
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private FilePatchStatus getStatus(final T patch) {
final String beforeName = PathUtil.toSystemIndependentName(patch.getBeforeName());
final String afterName = PathUtil.toSystemIndependentName(patch.getAfterName());
if (patch.isNewFile() || (beforeName == null)) {
return FilePatchStatus.ADDED;
}
else if (patch.isDeletedFile() || (afterName == null)) {
return FilePatchStatus.DELETED;
}
if (beforeName.equals(afterName)) return FilePatchStatus.MODIFIED;
return FilePatchStatus.MOVED_OR_RENAMED;
}
示例5: StripCapablePath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private StripCapablePath(final String path) {
final String corrected = PathUtil.toSystemIndependentName(path.trim());
mySourcePath = new StringBuilder(corrected);
final String[] steps = corrected.split("/");
myStripMax = steps.length - 1;
myParts = new int[steps.length];
int pos = 0;
for (int i = 0; i < steps.length; i++) {
final String step = steps[i];
myParts[i] = pos;
pos += step.length() + 1; // plus 1 for separator
}
myCurrentStrip = 0;
}
示例6: readSourcePath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private static String readSourcePath(JsonReaderEx reader) {
return PathUtil.toSystemIndependentName(StringUtil.nullize(reader.nextString().trim()));
}
示例7: setProfilesIniPath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setProfilesIniPath(@Nullable String value) {
myProfilesIniPath = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}
示例8: getConfiguredProfileIniPath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private String getConfiguredProfileIniPath() {
String path = PathUtil.toSystemIndependentName(StringUtil.nullize(myProfilesIniPathField.getText()));
return myDefaultProfilesIniPath.equals(path) ? null : path;
}
示例9: setUserDataDirectoryPath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setUserDataDirectoryPath(@Nullable String value) {
myUserDataDirectoryPath = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}
示例10: setPath
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void setPath(@Nullable String value) {
path = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
}