Always return new stream
This commit is contained in:
parent
e85cdf9445
commit
c277bf9e17
1 changed files with 2 additions and 16 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue