From c277bf9e17810f890826f646a8504b808b02c7bd Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 11 Jan 2025 19:23:06 +0100 Subject: [PATCH] Always return new stream --- .../engine/base/utility/FileAccess.kt | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt index 347c686..419f453 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt @@ -21,10 +21,10 @@ package de.staropensource.engine.base.utility import de.staropensource.engine.base.Engine.Companion.logger import de.staropensource.engine.base.annotation.NonKotlinContact +import de.staropensource.engine.base.exception.VerificationFailedException import de.staropensource.engine.base.exception.io.FileOrDirectoryNotFoundException import de.staropensource.engine.base.exception.io.FileTooLargeException import de.staropensource.engine.base.exception.io.IOAccessException -import de.staropensource.engine.base.exception.VerificationFailedException import de.staropensource.engine.base.implementable.stream.Stream import de.staropensource.engine.base.implementation.stream.FileAccessStream import de.staropensource.engine.base.utility.Environment.OperatingSystem.* @@ -304,15 +304,6 @@ class FileAccess { @JvmName(name = "getJavaFile") get - /** - * Contains the [FileAccessStream] for this instance. - * - * @since v1-alpha10 - */ - private var stream: FileAccessStream? = null - @NonKotlinContact - @JvmName(name = "getActualStream") get - // -----> Constructors /** @@ -577,12 +568,7 @@ class FileAccess { * @return [FileAccessStream] instance * @since v1-alpha10 */ - fun toStream(): FileAccessStream { - if (stream == null) - stream = FileAccessStream(this) - - return stream!! - } + fun toStream(): FileAccessStream = FileAccessStream(this) // -----> File creation, moving, copying and deletion