Package com.helger.as2lib.util.http
Class TempSharedFileInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
jakarta.mail.util.SharedFileInputStream
com.helger.as2lib.util.http.TempSharedFileInputStream
- All Implemented Interfaces:
jakarta.mail.internet.SharedInputStream
,Closeable
,AutoCloseable
public class TempSharedFileInputStream
extends jakarta.mail.util.SharedFileInputStream
Stores the content of the input
InputStream
in a temporary file, and
opens SharedFileInputStream
on that file. When the stream is closed,
the file will be deleted, and the input stream will be closed.-
Field Summary
Fields inherited from class jakarta.mail.util.SharedFileInputStream
bufpos, bufsize, datalen, in, start
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
close - Do nothing, to prevent early close, as the cryptographic processing stages closes their input streamvoid
closeAll()
Deprecated, for removal: This API element is subject to removal in a future version.Since 4.10.2.void
closeAll - closes the input stream, and deletes the backing fileprotected void
finalize()
finalize - closes also the input stream, and deletes the backing filestatic TempSharedFileInputStream
getTempSharedFileInputStream
(InputStream aIS, String sName) Stores the content of the inputInputStream
in a temporary file (in the system temporary directory, and opensSharedFileInputStream
on that file.protected static File
storeContentToTempFile
(InputStream aIS, String sName) Stores the content of the inputInputStream
in a temporary file (in the system temporary directory.Methods inherited from class jakarta.mail.util.SharedFileInputStream
available, getPosition, mark, markSupported, newStream, read, read, reset, skip
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Method Details
-
close
close - Do nothing, to prevent early close, as the cryptographic processing stages closes their input stream- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classjakarta.mail.util.SharedFileInputStream
- Throws:
IOException
-
finalize
finalize - closes also the input stream, and deletes the backing file- Overrides:
finalize
in classjakarta.mail.util.SharedFileInputStream
- Throws:
Throwable
-
closeAll
Deprecated, for removal: This API element is subject to removal in a future version.Since 4.10.2. UsecloseAndDelete()
insteadcloseAll - closes the input stream, and deletes the backing file- Throws:
IOException
- in case of error
-
closeAndDelete
closeAll - closes the input stream, and deletes the backing file- Throws:
IOException
- in case of error- Since:
- 4.10.2
-
storeContentToTempFile
@Nonnull protected static File storeContentToTempFile(@Nonnull @WillClose InputStream aIS, @Nonnull String sName) throws IOException Stores the content of the inputInputStream
in a temporary file (in the system temporary directory.- Parameters:
aIS
-InputStream
to read fromsName
- name to use in the temporary file to link it to the delivered message. May be null- Returns:
- The created
File
- Throws:
IOException
- in case of IO error
-