Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to update lastaccesstime of a remote file ?  RSS feed

 
pradeep g mishra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I wanted to know how can I programatically update the "Last Access Time" of a file which is sitting in a remote system shared through windows file share (DFS).

I have access to SmbFile but not sure how can I access java.io.File object for a remote file.

Any help will be highly appreciated?
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can access files on a remote share using java.io.File, as long as a) the file's path starts with \\ or // (I usually use //, otherwise I have to escape \\ to \\\\), and b) the user that is running the Java program has access to the remote share.

But you say you have an SmbFile. Have you tried its own setLastModified method?
 
Tony Docherty
Bartender
Posts: 3210
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!