Replaced sure() invocations with '!!' operator in examples code.
This commit is contained in:
@@ -36,7 +36,7 @@ public object FileSystem {
|
||||
*/
|
||||
public fun getFileByIoFile(ioFile : File) : VirtualFile {
|
||||
FileSystem.assertCanRead()
|
||||
return PhysicalVirtualFile(ioFile.getAbsolutePath().sure().toSystemIndependentPath())
|
||||
return PhysicalVirtualFile(ioFile.getAbsolutePath()!!.toSystemIndependentPath())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,7 @@ internal object RefreshQueue {
|
||||
/* Deletes file from file system recursively, notifying listeners */
|
||||
private fun deleteRecursively(file : VirtualFile) {
|
||||
val fileInfoMaybe : VirtualFileInfo? = FileSystem.fileToInfo[file.path]
|
||||
val fileInfo = fileInfoMaybe.sure()
|
||||
val fileInfo = fileInfoMaybe!!
|
||||
fileInfo.children.forEach{ deleteRecursively(it) }
|
||||
FileSystem.notifyEventHappened(VirtualFileDeletedEvent(file))
|
||||
FileSystem.fileToInfo.remove(file)
|
||||
|
||||
@@ -94,7 +94,7 @@ public class PhysicalVirtualFile(path : String) : VirtualFile(path) {
|
||||
get() {
|
||||
FileSystem.assertCanRead()
|
||||
return (ioFile.listFiles() ?: array<File?>()).
|
||||
map{ FileSystem.getFileByIoFile(it.sure()) }?.toList()
|
||||
map{ FileSystem.getFileByIoFile(it!!) }?.toList()
|
||||
}
|
||||
|
||||
override public fun openInputStream(): InputStream {
|
||||
@@ -106,7 +106,7 @@ public class PhysicalVirtualFile(path : String) : VirtualFile(path) {
|
||||
}
|
||||
}
|
||||
|
||||
private val OS_SEPARATOR = java.io.File.separator.sure()
|
||||
private val OS_SEPARATOR = java.io.File.separator!!
|
||||
private val VFS_SEPARATOR = "/"
|
||||
|
||||
private fun String.toSystemDependentPath() : String {
|
||||
|
||||
Reference in New Issue
Block a user