No file creation/modified date when a file created using HTTP PUT in java/Android -
i developing app android reads/write wireless device using http put.
is there way set creation/modified date & time attribute of file being created http put because @ moment file created fine no attributes (creation datetime, modified datetime.
let me know if need code snippet.(not sure help)
could fallback of device i.e. device responsible adding these attributes file?
i have tried searching net problem hard explain in 1 line/few words :)
thanks in advance.
edit: clarify, file trying write exists http put overriding it.(simple text file). , pass bytearray entity written file. somehow in process, file attributes getting lost.
edit: following uploadfile code snippet. private void uploadfile(string data){
try{ httpclient http = new defaulthttpclient(); //declare , initialize http client. //using http put, upload data settings file httpput putmethod = new httpput("http://airstash.net/files/settings.txt"); putmethod.setentity(new bytearrayentity(data.getbytes("iso-8859-1"))); putmethod.setheader("content_type", "text/plain"); httpresponse response = http.execute(putmethod); //execute put request , receive response. if(response!= null) { //show response code (for testing only) string responsecode = integer.tostring(response.getstatusline().getstatuscode()); toast.maketext(getapplicationcontext(), responsecode, toast.length_long).show(); } } catch(exception e){ e.printstacktrace(); } }
what's wrong file.setlastmodified(long)
?
some old reports doesn't work appears fixed.
i can't find information on setting creation date because creation date should set when file created automatically.
Comments
Post a Comment