本文整理汇总了Java中com.intellij.openapi.util.io.FileUtil.resolveShortWindowsName方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.resolveShortWindowsName方法的具体用法?Java FileUtil.resolveShortWindowsName怎么用?Java FileUtil.resolveShortWindowsName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.io.FileUtil
的用法示例。
在下文中一共展示了FileUtil.resolveShortWindowsName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateLastProjectLocation
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public static void updateLastProjectLocation(final String projectFilePath) {
File lastProjectLocation = new File(projectFilePath);
if (lastProjectLocation.isFile()) {
lastProjectLocation = lastProjectLocation.getParentFile(); // for directory-based project storage
}
if (lastProjectLocation == null) { // the immediate parent of the ipr file
return;
}
lastProjectLocation = lastProjectLocation.getParentFile(); // the candidate directory to be saved
if (lastProjectLocation == null) {
return;
}
String path = lastProjectLocation.getPath();
try {
path = FileUtil.resolveShortWindowsName(path);
}
catch (IOException e) {
LOG.info(e);
return;
}
RecentProjectsManager.getInstance().setLastProjectCreationLocation(path.replace(File.separatorChar, '/'));
}
示例2: setContentEntryPath
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
public void setContentEntryPath(String moduleRootPath) {
final String path = acceptParameter(moduleRootPath);
if (path != null) {
try {
myContentEntryPath = FileUtil.resolveShortWindowsName(path);
}
catch (IOException e) {
myContentEntryPath = path;
}
}
else {
myContentEntryPath = null;
}
if (myContentEntryPath != null) {
myContentEntryPath = myContentEntryPath.replace(File.separatorChar, '/');
}
}
示例3: getUrl
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public static String getUrl(@NonNls String path) {
try {
path = FileUtil.resolveShortWindowsName(path);
}
catch (IOException ignored) { }
return VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(path));
}
示例4: getCanonicalDir
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private static File getCanonicalDir(File baseDir) {
try {
return new File(FileUtil.resolveShortWindowsName(baseDir.getAbsolutePath()));
}
catch (IOException e) {
LOG.info(e);
return baseDir;
}
}
示例5: resolveShortWindowsName
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
private String resolveShortWindowsName(@NotNull String filePath) {
try {
return FileUtil.resolveShortWindowsName(filePath);
}
catch (IOException ignored) {
return filePath;
}
}
示例6: toCanonicalName
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
private static String toCanonicalName(@NotNull final String filePath) {
try {
return FileUtil.resolveShortWindowsName(filePath);
}
catch (IOException e) {
// OK. File does not yet exist so it's canonical path will be equal to its original path.
}
return filePath;
}
示例7: setupRootModel
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class);
compilerModuleExtension.setExcludeOutput(true);
if (myJdk != null){
rootModel.setSdk(myJdk);
} else {
rootModel.inheritSdk();
}
ContentEntry contentEntry = doAddContentEntry(rootModel);
if (contentEntry != null) {
final List<Pair<String,String>> sourcePaths = getSourcePaths();
if (sourcePaths != null) {
for (final Pair<String, String> sourcePath : sourcePaths) {
String first = sourcePath.first;
new File(first).mkdirs();
final VirtualFile sourceRoot = LocalFileSystem.getInstance()
.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(first));
if (sourceRoot != null) {
contentEntry.addSourceFolder(sourceRoot, false, sourcePath.second);
}
}
}
}
if (myCompilerOutputPath != null) {
// should set only absolute paths
String canonicalPath;
try {
canonicalPath = FileUtil.resolveShortWindowsName(myCompilerOutputPath);
}
catch (IOException e) {
canonicalPath = myCompilerOutputPath;
}
compilerModuleExtension
.setCompilerOutputPath(VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(canonicalPath)));
}
else {
compilerModuleExtension.inheritCompilerOutputPath(true);
}
LibraryTable libraryTable = rootModel.getModuleLibraryTable();
for (Pair<String, String> libInfo : myModuleLibraries) {
final String moduleLibraryPath = libInfo.first;
final String sourceLibraryPath = libInfo.second;
Library library = libraryTable.createLibrary();
Library.ModifiableModel modifiableModel = library.getModifiableModel();
modifiableModel.addRoot(getUrlByPath(moduleLibraryPath), OrderRootType.CLASSES);
if (sourceLibraryPath != null) {
modifiableModel.addRoot(getUrlByPath(sourceLibraryPath), OrderRootType.SOURCES);
}
modifiableModel.commit();
}
}