Always return new stream
All checks were successful
PRs & Pushes / test (push) Successful in 5m22s
PRs & Pushes / build-jars (push) Successful in 5m21s
PRs & Pushes / build-apidoc (push) Successful in 5m35s

This commit is contained in:
JeremyStar™ 2025-01-11 19:23:06 +01:00
parent e85cdf9445
commit c277bf9e17
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -21,10 +21,10 @@ package de.staropensource.engine.base.utility
import de.staropensource.engine.base.Engine.Companion.logger import de.staropensource.engine.base.Engine.Companion.logger
import de.staropensource.engine.base.annotation.NonKotlinContact 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.FileOrDirectoryNotFoundException
import de.staropensource.engine.base.exception.io.FileTooLargeException import de.staropensource.engine.base.exception.io.FileTooLargeException
import de.staropensource.engine.base.exception.io.IOAccessException 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.implementable.stream.Stream
import de.staropensource.engine.base.implementation.stream.FileAccessStream import de.staropensource.engine.base.implementation.stream.FileAccessStream
import de.staropensource.engine.base.utility.Environment.OperatingSystem.* import de.staropensource.engine.base.utility.Environment.OperatingSystem.*
@ -304,15 +304,6 @@ class FileAccess {
@JvmName(name = "getJavaFile") @JvmName(name = "getJavaFile")
get get
/**
* Contains the [FileAccessStream] for this instance.
*
* @since v1-alpha10
*/
private var stream: FileAccessStream? = null
@NonKotlinContact
@JvmName(name = "getActualStream") get
// -----> Constructors // -----> Constructors
/** /**
@ -577,12 +568,7 @@ class FileAccess {
* @return [FileAccessStream] instance * @return [FileAccessStream] instance
* @since v1-alpha10 * @since v1-alpha10
*/ */
fun toStream(): FileAccessStream { fun toStream(): FileAccessStream = FileAccessStream(this)
if (stream == null)
stream = FileAccessStream(this)
return stream!!
}
// -----> File creation, moving, copying and deletion // -----> File creation, moving, copying and deletion