本文整理匯總了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();
}
}