Java Code Examples for com.intellij.openapi.util.io.FileUtilRt#getParentFile()

The following examples show how to use com.intellij.openapi.util.io.FileUtilRt#getParentFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BackgroundTaskByVfsChangeTaskImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
public ExpandMacroToPathMap createExpandMacroToPathMap() {
  final ExpandMacroToPathMap expandMacroToPathMap = new ExpandMacroToPathMap();
  expandMacroToPathMap.addMacroExpand("FileName", myVirtualFilePointer.getFileName());
  expandMacroToPathMap.addMacroExpand("FilePath", myVirtualFilePointer.getPresentableUrl());

  File parentFile = FileUtilRt.getParentFile(new File(myVirtualFilePointer.getPresentableUrl()));
  expandMacroToPathMap.addMacroExpand("FileParentPath", parentFile.getAbsolutePath());
  return expandMacroToPathMap;
}
 
Example 2
Source File: BackgroundTaskByVfsChangeTaskImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private ExpandMacroToPathMap createExpandOutMacroToPathMap() {
  final ExpandMacroToPathMap expandMacroToPathMap = new ExpandMacroToPathMap();
  expandMacroToPathMap.addMacroExpand("FileName", myVirtualFilePointer.getFileName());
  expandMacroToPathMap.addMacroExpand("FilePath", myVirtualFilePointer.getPresentableUrl());
  expandMacroToPathMap.addMacroExpand("OutPath", myParameters.getOutPath());

  File parentFile = FileUtilRt.getParentFile(new File(myVirtualFilePointer.getPresentableUrl()));
  expandMacroToPathMap.addMacroExpand("FileParentPath", parentFile.getAbsolutePath());
  return expandMacroToPathMap;
}
 
Example 3
Source File: BackgroundTaskByVfsChangeTaskImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
public ReplacePathToMacroMap createReplaceMacroToPathMap() {
  final ReplacePathToMacroMap replacePathToMacroMap = new ReplacePathToMacroMap();
  replacePathToMacroMap.put(myVirtualFilePointer.getFileName(), "$FileName$");
  replacePathToMacroMap.addMacroReplacement(myVirtualFilePointer.getPresentableUrl(), "FilePath");

  File parentFile = FileUtilRt.getParentFile(new File(myVirtualFilePointer.getPresentableUrl()));
  replacePathToMacroMap.addMacroReplacement(parentFile.getAbsolutePath(), "FileParentPath");
  return replacePathToMacroMap;
}