rishabhdaim commented on code in PR #2744:
URL: https://github.com/apache/jackrabbit-oak/pull/2744#discussion_r2827695701
##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/AbstractSharedCachingDataStore.java:
##########
@@ -323,11 +322,16 @@ public InputStream getStream() throws DataStoreException {
try {
// If cache configured to 0 will return null
if (cached == null || !cached.exists()) {
- TransientFileFactory fileFactory =
TransientFileFactory.getInstance();
- File tmpFile =
fileFactory.createTransientFile("temp0cache", null, temp);
+ final File tmpFile = Files.createTempFile(temp.toPath(),
"blob-cache-", null).toFile();
try (InputStream in =
backend.getRecord(getIdentifier()).getStream()) {
copyInputStreamToFile(in, tmpFile);
- return new LazyFileInputStream(tmpFile);
+ return new FileInputStream(tmpFile);
Review Comment:
Won't this cause issues, since we are deleting the file before returning the
`FileInputStream`?
cc @amit-jain
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]