last-modified


If-Modified-Since HTTP header passed by IE9 includes length?

五迷三道 提交于 2020-01-24 04:00:16
问题 Please clarify this weird If-Modified-Since header passed by IE9 In my ASP.NET 4.0 web app, I've got a generic handler (.ashx) that serves images stored in the DB. In the interest of efficiency, I'm handling some caching-related headers and passing cache information. I'm getting DateTime parse errors moderately frequently from trying to parse the If-Modified-Since header contents, usually from IE9. Turns out it's sending something like this: Mon, 28 Nov 2011 16:34:52 GMT; length=8799 I'm

How do I get the last modification time of a Java resource?

落花浮王杯 提交于 2020-01-24 02:08:48
问题 Can someone please tell me a reliable way to get the last modification time of a Java resource? The resource can be a file or an entry in a JAR. 回答1: If you with "resource" mean something reachable through Class#getResource or ClassLoader#getResource, you can get the last modified time stamp through the URLConnection: URL url = Test.class.getResource("/org/jdom/Attribute.class"); System.out.println(new Date(url.openConnection().getLastModified())); Be aware that getLastModified() returns 0 if

Is it possible to reset the last modified date of an Android file?

青春壹個敷衍的年華 提交于 2020-01-23 17:54:22
问题 I'm writing a purge function for our software that removes all image files that haven't been used in over a month. To do this, I am checking two things: the last-modified date of the file a query on a database that shows recently viewed files. The query is much slower than the file check. So I would ideally like to be able to reset the last modified date on any files that fail the first check, but pass the second, so that (for example) a list of venerable but often-used files aren't gradually

Getting last modified date of a file not the last created date in Java

蓝咒 提交于 2020-01-15 11:36:37
问题 I had copied a file to my android device. When i check it's last modified date with file.lastModified() it returns the date the file was created which is just now. I want the original date when the file was last modified and not copied. I can see this date in windows explorer with the tag Date modified .The file.lastModified() matches with the Date created Tag of the file. If i could get the last Modified Date i can update the file with another file from server after it has been updated by

Getting last modified date of a file not the last created date in Java

ε祈祈猫儿з 提交于 2020-01-15 11:31:46
问题 I had copied a file to my android device. When i check it's last modified date with file.lastModified() it returns the date the file was created which is just now. I want the original date when the file was last modified and not copied. I can see this date in windows explorer with the tag Date modified .The file.lastModified() matches with the Date created Tag of the file. If i could get the last Modified Date i can update the file with another file from server after it has been updated by

File.lastModified() painfully slow!

烈酒焚心 提交于 2020-01-14 10:22:49
问题 I'm doing a recursive copy of files and like xcopy /D I only want to copy newer files destination files (I cannot use xcopy directly since I need to alter some files in the copy process). In java I use lastModified() to check if the destination file is older than the source file and it's very slow. Can I speed up the process (maybe using JNI??)? Are there any other copy scripts that can do the job better (copy new files + regexp change some text files)? Copying files anyways is not an option

File.lastModified() painfully slow!

我们两清 提交于 2020-01-14 10:21:12
问题 I'm doing a recursive copy of files and like xcopy /D I only want to copy newer files destination files (I cannot use xcopy directly since I need to alter some files in the copy process). In java I use lastModified() to check if the destination file is older than the source file and it's very slow. Can I speed up the process (maybe using JNI??)? Are there any other copy scripts that can do the job better (copy new files + regexp change some text files)? Copying files anyways is not an option

how to tell when a HTTP web page has changed when it is of type html/text?

允我心安 提交于 2020-01-14 06:10:49
问题 I'm trying to work out the algorithm to tell if non-binary files on the web have changed or not. I was going to go with: LastModified datetime from header, and then if these aren't present fallback to ContentLength from header I'm finding however that for alot of websites the LastModified for the HTML pages are actually just using the current DateTime, hence the approach doesn't work (i.e. would lead to an indication that the page is always changing) I think...? What would be a good algorithm

how to tell when a HTTP web page has changed when it is of type html/text?

狂风中的少年 提交于 2020-01-14 06:10:06
问题 I'm trying to work out the algorithm to tell if non-binary files on the web have changed or not. I was going to go with: LastModified datetime from header, and then if these aren't present fallback to ContentLength from header I'm finding however that for alot of websites the LastModified for the HTML pages are actually just using the current DateTime, hence the approach doesn't work (i.e. would lead to an indication that the page is always changing) I think...? What would be a good algorithm

How to preserve date modified when retrieving file using Apache FTPClient?

蓝咒 提交于 2020-01-11 05:59:28
问题 I am using org.apache.commons.net.ftp.FTPClient for retrieving files from a ftp server. It is crucial that I preserve the last modified timestamp on the file when its saved on my machine. Do anyone have a suggestion for how to solve this? 回答1: This is how I solved it: public boolean retrieveFile(String path, String filename, long lastModified) throws IOException { File localFile = new File(path + "/" + filename); OutputStream outputStream = new FileOutputStream(localFile); boolean success =

工具导航Map