How to set last modified date using TrueVFS

76 Views Asked by At

How can I set the last modified date of a file using TrueVFS? Because accordingly to the (manual) it should be as simple as

File entry = new TFile("archive.zip/dir/HälloWörld.txt");
entry.setLastModified(System.currentTimeMillis());

But this doesn't work for files, but if I do the same thing for a folder it works.

This is what I'm using

String NUMBER_FILE = "C:/333/ServerEAR.ear/1.txt";

String newLastModified = "11/12/1999 14:15:16";
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
long newDate = sdf.parse(newLastModified).getTime();

File entry = new TFile(NUMBER_FILE);
boolean result = entry.setLastModified(newDate);

Although the result is true the date isn't modified to the one I want

0

There are 0 best solutions below