mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Change file modified date on returned content from web script of type 'ContentStream', fix for SLNG- 894, change relating to SLNG-989, assertNotNull added to JS unit test API
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10223 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -47,7 +47,7 @@ function main()
|
||||
|
||||
// Get the thumbnail
|
||||
var thumbnail = node.getThumbnail(thumbnailName);
|
||||
if (thumbnail == null)
|
||||
if (thumbnail == null || thumbnail.size == 0)
|
||||
{
|
||||
// Queue the creation of the thumbnail if appropriate
|
||||
if (fc)
|
||||
|
@@ -30,6 +30,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
import java.net.SocketException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -400,6 +401,11 @@ public class StreamContent extends AbstractWebScript
|
||||
}
|
||||
}
|
||||
|
||||
// Create a date in the past
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(1975, 3, 26);
|
||||
|
||||
|
||||
File file = TempFileProvider.createTempFile("streamContent-", ext);
|
||||
InputStream is = this.getClass().getClassLoader().getResourceAsStream(resourcePath);
|
||||
OutputStream os = new FileOutputStream(file);
|
||||
@@ -409,7 +415,7 @@ public class StreamContent extends AbstractWebScript
|
||||
reader.setMimetype(mimetype);
|
||||
reader.setEncoding("UTF-8");
|
||||
|
||||
streamContentImpl(req, res, reader, attach, new Date(file.lastModified()));
|
||||
streamContentImpl(req, res, reader, attach, calendar.getTime());
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user