Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
43121495
Commit
43121495
authored
7 years ago
by
Ilya.Kazakevich
Browse files
Options
Download
Email Patches
Plain Diff
IDEA-85995: Remove unneeded code and constant
parent
201eef78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
platform/platform-api/src/com/intellij/execution/util/ExecUtil.java
+1
-1
...latform-api/src/com/intellij/execution/util/ExecUtil.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt
+1
-1
...m/intellij/openapi/updateSettings/impl/UpdateInstaller.kt
platform/util/src/com/intellij/openapi/application/PathManager.java
+0
-4
...til/src/com/intellij/openapi/application/PathManager.java
platform/util/src/com/intellij/openapi/util/io/FileUtil.java
+1
-38
platform/util/src/com/intellij/openapi/util/io/FileUtil.java
with
3 additions
and
44 deletions
+3
-44
platform/platform-api/src/com/intellij/execution/util/ExecUtil.java
+
1
-
1
View file @
43121495
...
...
@@ -150,7 +150,7 @@ public class ExecUtil {
final
GeneralCommandLine
sudoCommandLine
;
if
(
SystemInfo
.
isWinVistaOrNewer
)
{
// launcher.exe process with elevated permissions on UAC.
final
File
launcherExe
=
PathManager
.
findBinFileWithException
(
PathManager
.
WIN_LAUNCHER
);
final
File
launcherExe
=
PathManager
.
findBinFileWithException
(
"launcher.exe"
);
sudoCommandLine
=
new
GeneralCommandLine
(
launcherExe
.
getPath
());
sudoCommandLine
.
setWorkDirectory
(
commandLine
.
getWorkDirectory
());
sudoCommandLine
.
addParameter
(
commandLine
.
getExePath
());
...
...
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt
+
1
-
1
View file @
43121495
...
...
@@ -136,7 +136,7 @@ object UpdateInstaller {
if
(
SystemInfo
.
isWindows
)
{
// launcher depends on elevator
val
launcher
=
PathManager
.
findBinFile
(
PathManager
.
WIN_LAUNCHER
)
val
launcher
=
PathManager
.
findBinFile
(
"launcher.exe"
)
val
elevator
=
PathManager
.
findBinFile
(
"elevator.exe"
)
if
(
launcher
!=
null
&&
elevator
!=
null
&&
launcher
.
canExecute
())
{
args
+=
Restarter
.
createTempExecutable
(
launcher
,
elevator
).
path
...
...
This diff is collapsed.
Click to expand it.
platform/util/src/com/intellij/openapi/application/PathManager.java
+
0
-
4
View file @
43121495
...
...
@@ -55,10 +55,6 @@ public class PathManager {
public
static
final
String
PROPERTY_LOG_PATH
=
"idea.log.path"
;
public
static
final
String
PROPERTY_PATHS_SELECTOR
=
"idea.paths.selector"
;
public
static
final
String
DEFAULT_OPTIONS_FILE_NAME
=
"other"
;
/**
* Tool to launch any command under UAC
*/
public
static
final
String
WIN_LAUNCHER
=
"launcher.exe"
;
private
static
final
String
PROPERTY_HOME
=
"idea.home"
;
// reduced variant of PROPERTY_HOME_PATH, now deprecated
...
...
This diff is collapsed.
Click to expand it.
platform/util/src/com/intellij/openapi/util/io/FileUtil.java
+
1
-
38
View file @
43121495
...
...
@@ -480,17 +480,7 @@ public class FileUtil extends FileUtilRt {
@SuppressWarnings
(
"Duplicates"
)
private
static
void
performCopy
(
@NotNull
File
fromFile
,
@NotNull
File
toFile
,
final
boolean
syncTimestamp
)
throws
IOException
{
if
(
filesEqual
(
fromFile
,
toFile
))
return
;
final
FileOutputStream
fos
;
try
{
fos
=
openOutputStream
(
toFile
);
}
catch
(
IOException
e
)
{
if
(
SystemInfo
.
isWindows
&&
e
.
getMessage
()
!=
null
&&
e
.
getMessage
().
contains
(
"denied"
)
&&
nativeWindowsCopy
(
fromFile
,
toFile
))
{
return
;
}
throw
e
;
}
final
FileOutputStream
fos
=
openOutputStream
(
toFile
);
try
{
final
FileInputStream
fis
=
new
FileInputStream
(
fromFile
);
...
...
@@ -520,33 +510,6 @@ public class FileUtil extends FileUtilRt {
}
}
private
static
boolean
nativeWindowsCopy
(
@NotNull
final
File
src
,
@NotNull
final
File
dst
)
{
final
File
launcher
=
PathManager
.
findBinFile
(
PathManager
.
WIN_LAUNCHER
);
if
(
launcher
==
null
||
!
launcher
.
exists
())
{
return
false
;
}
try
{
final
ProcessBuilder
builder
=
new
ProcessBuilder
(
launcher
.
getAbsolutePath
(),
"cmd.exe"
,
"/C"
,
"copy"
,
src
.
getAbsolutePath
(),
dst
.
getAbsolutePath
());
final
Process
process
=
builder
.
start
();
final
String
error
=
StreamUtil
.
readText
(
process
.
getErrorStream
(),
Charset
.
defaultCharset
());
final
String
out
=
StreamUtil
.
readText
(
process
.
getInputStream
(),
Charset
.
defaultCharset
());
LOG
.
info
(
"out"
+
out
);
LOG
.
info
(
"error"
+
error
);
return
process
.
waitFor
()
==
0
;
}
catch
(
final
IOException
ex
)
{
LOG
.
warn
(
ex
);
return
false
;
}
catch
(
final
InterruptedException
ex
)
{
LOG
.
warn
(
ex
);
return
false
;
}
}
private
static
FileOutputStream
openOutputStream
(
@NotNull
final
File
file
)
throws
IOException
{
try
{
return
new
FileOutputStream
(
file
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help