Use NIO Files for creating temp files: idea plugin
This commit is contained in:
@@ -20,6 +20,8 @@ import com.intellij.openapi.application.ApplicationManager;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
public class PluginStartupApplicationService {
|
public class PluginStartupApplicationService {
|
||||||
|
|
||||||
@@ -32,9 +34,9 @@ public class PluginStartupApplicationService {
|
|||||||
public synchronized String getAliveFlagPath() {
|
public synchronized String getAliveFlagPath() {
|
||||||
if (this.aliveFlagPath == null) {
|
if (this.aliveFlagPath == null) {
|
||||||
try {
|
try {
|
||||||
File flagFile = File.createTempFile("kotlin-idea-", "-is-running");
|
Path flagFile = Files.createTempFile("kotlin-idea-", "-is-running");
|
||||||
flagFile.deleteOnExit();
|
flagFile.toFile().deleteOnExit();
|
||||||
this.aliveFlagPath = flagFile.getAbsolutePath();
|
this.aliveFlagPath = flagFile.toAbsolutePath().toString();
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
this.aliveFlagPath = "";
|
this.aliveFlagPath = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user