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
f129f666
Commit
f129f666
authored
6 years ago
by
Vasily Romanikhin
Browse files
Options
Download
Email Patches
Plain Diff
CPP-15607: remote-dev performance: utility method without additional checks
parent
22c90745
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform/projectModel-api/src/com/intellij/util/io/path.kt
+21
-1
platform/projectModel-api/src/com/intellij/util/io/path.kt
with
21 additions
and
1 deletion
+21
-1
platform/projectModel-api/src/com/intellij/util/io/path.kt
+
21
-
1
View file @
f129f666
...
...
@@ -201,7 +201,11 @@ fun Path.writeSafe(outConsumer: (OutputStream) -> Unit): Path {
@Throws
(
IOException
::
class
)
fun
Path
.
write
(
data
:
String
):
Path
{
parent
?.
createDirectories
()
return
writeUnsafe
(
data
)
}
@Throws
(
IOException
::
class
)
fun
Path
.
writeUnsafe
(
data
:
String
):
Path
{
Files
.
write
(
this
,
data
.
toByteArray
())
return
this
}
...
...
@@ -300,4 +304,20 @@ fun sanitizeFileName(name: String, replacement: String? = "_", isTruncate: Boole
}
val
Path
.
isWritable
:
Boolean
get
()
=
Files
.
isWritable
(
this
)
\ No newline at end of file
get
()
=
Files
.
isWritable
(
this
)
fun
isDirectory
(
attributes
:
BasicFileAttributes
?):
Boolean
{
return
attributes
!=
null
&&
attributes
.
isDirectory
}
fun
isSymbolicLink
(
attributes
:
BasicFileAttributes
?):
Boolean
{
return
attributes
!=
null
&&
attributes
.
isSymbolicLink
}
fun
Path
.
deleteRegularFile
()
{
try
{
Files
.
delete
(
this
)
}
catch
(
ignore
:
Exception
)
{
}
}
\ No newline at end of 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