• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

renameTo(File dest) Method

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I am unable to understand the renameTo method of the File class in JAVA.It says that it renames the file denoted by this abstract pathname.

But in one of the application which we developed, we are using this method to transfer the file to a destination.So what we do is , we encrypt the file and send that file to the destination which can be any path .

So can anyone clear my doubts on the same?

Thanks in advance,

Saurabh
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Javadocs say "Renames the file denoted by this abstract pathname. Whether or not this method can move a file from one filesystem to another is platform-dependent."
So it can both rename and move (although the latter may fail under certain circumstances). What exactly are your doubts about this? And what does encryption have to do with it?
(Note that Unix -e.g.- uses the same command -mv- for renaming and moving.)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic