本文整理汇总了Java中com.intellij.openapi.application.PathManager.getConfigPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathManager.getConfigPath方法的具体用法?Java PathManager.getConfigPath怎么用?Java PathManager.getConfigPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.application.PathManager
的用法示例。
在下文中一共展示了PathManager.getConfigPath方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGetSettingsFilePath
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
@NotNull
private static String doGetSettingsFilePath(boolean customLocation) {
final String vmOptionsFile = System.getProperty("jb.vmOptionsFile");
if (!StringUtil.isEmptyOrSpaces(vmOptionsFile)) {
return vmOptionsFile;
}
if (SystemInfo.isMac) {
if (customLocation) {
return PathManager.getConfigPath() + "/idea.vmoptions";
}
else {
return PathManager.getBinPath() + "/idea.vmoptions";
}
}
final String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase(Locale.US);
final String platformSuffix = SystemInfo.is64Bit ? "64" : "";
final String osSuffix = SystemInfo.isWindows ? ".exe" : "";
return PathManager.getBinPath() + File.separatorChar + productName + platformSuffix + osSuffix + ".vmoptions";
}
示例2: copyFiles
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private void copyFiles(ArrayList<File> files) {
String configPath = PathManager.getConfigPath();
createFolder(configPath + "/codestyles");
for(File file : files) {
try {
copyFile(file, new File(configPath + "/codestyles/" + file.getName()));
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例3: PyStudyInitialConfigurator
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
/**
* @noinspection UnusedParameters
*/
public PyStudyInitialConfigurator(MessageBus bus,
CodeInsightSettings codeInsightSettings,
final PropertiesComponent propertiesComponent,
FileTypeManager fileTypeManager,
final ProjectManagerEx projectManager) {
if (!propertiesComponent.getBoolean(CONFIGURED_V40)) {
final File courses = new File(PathManager.getConfigPath(), "courses");
FileUtil.delete(courses);
propertiesComponent.setValue(CONFIGURED_V40, "true");
}
}
示例4: getMapDirectory
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private static File getMapDirectory() {
File dir = new File(PathManager.getConfigPath() + File.separator + "migration");
if (!dir.exists()){
if (!dir.mkdir()){
LOG.error("cannot create directory: " + dir.getAbsolutePath());
return null;
}
for (int i = 0; i < DEFAULT_MAPS.length; i++) {
String defaultTemplate = DEFAULT_MAPS[i];
URL url = MigrationMapSet.class.getResource(defaultTemplate);
LOG.assertTrue(url != null);
String fileName = defaultTemplate.substring(defaultTemplate.lastIndexOf("/") + 1);
File targetFile = new File(dir, fileName);
try {
FileOutputStream outputStream = new FileOutputStream(targetFile);
InputStream inputStream = url.openStream();
try {
FileUtil.copy(inputStream, outputStream);
}
finally {
outputStream.close();
inputStream.close();
}
}
catch (Exception e) {
LOG.error(e);
}
}
}
return dir;
}
示例5: getDefaultUserDataPath
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private static String getDefaultUserDataPath() {
File dir = new File(PathManager.getConfigPath(), "chrome-user-data");
try {
return FileUtil.toSystemIndependentName(dir.getCanonicalPath());
}
catch (IOException e) {
return FileUtil.toSystemIndependentName(dir.getAbsolutePath());
}
}
示例6: lockSystemFolders
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private synchronized static boolean lockSystemFolders(String[] args) {
if (ourLock != null) {
throw new AssertionError();
}
ourLock = new SocketLock(PathManager.getConfigPath(), PathManager.getSystemPath());
SocketLock.ActivateStatus status;
try {
status = ourLock.lock(args);
}
catch (Exception e) {
Main.showMessage("Cannot Lock System Folders", e);
return false;
}
if (status == SocketLock.ActivateStatus.NO_INSTANCE) {
ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
@Override
public void run() {
ourLock.dispose();
}
});
return true;
}
else if (Main.isHeadless() || status == SocketLock.ActivateStatus.CANNOT_ACTIVATE) {
String message = "Only one instance of " + ApplicationNamesInfo.getInstance().getFullProductName() + " can be run at a time.";
Main.showMessage("Too Many Instances", message, true);
}
return false;
}
示例7: getArchiveFile
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private File getArchiveFile(String postfix) {
File tasksFolder = new File(PathManager.getConfigPath(), TASKS_FOLDER);
if (!tasksFolder.exists()) {
//noinspection ResultOfMethodCallIgnored
tasksFolder.mkdirs();
}
String projectName = FileUtil.sanitizeFileName(myProject.getName());
return new File(tasksFolder, projectName + postfix);
}
示例8: getCustomTemplatesPath
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
@NotNull
static String getCustomTemplatesPath() {
return PathManager.getConfigPath() + "/projectTemplates";
}
示例9: saveDisabledPlugins
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
public static void saveDisabledPlugins(@NotNull Collection<String> ids, boolean append) throws IOException {
File plugins = new File(PathManager.getConfigPath(), DISABLED_PLUGINS_FILENAME);
savePluginsList(ids, append, plugins);
ourDisabledPlugins = null;
}
示例10: actionPerformed
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
String configPath = PathManager.getConfigPath();
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(configPath);
Project project = event.getData(PlatformDataKeys.PROJECT);
new ExampleCopyResourcesFolderForm(project);
}
示例11: ExampleCopyResourcesFolderForm
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
public ExampleCopyResourcesFolderForm(Project project) {
super("ExampleCopyResourcesFolderForm");
this.project = project;
String configPath = PathManager.getConfigPath();
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(configPath);
VirtualFile templatesFolder = null; // folder with templates in android (dest)
for (VirtualFile children : file.getChildren()) {
if (children.getName().equals("fileTemplates")) {
templatesFolder = children;
break;
}
}
if (templatesFolder != null) { // Copy templates files in template folder
}
}