• 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

Path Class issue

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I developed a simple app using the path class to access and copy some file
from one directory to the other.. After few months, i upgraded my JDK and later
found put that the .copyTo method is reporting an error... Has the method been deprecated?.
the code snippet is as follow;




[Added code tags - see UseCodeTags]
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dayo. Welcome to the Ranch!

And what error is it reporting?

According to the API docs, java.nio.file.Path, that method doesn't exist. It's not marked as deprecated, which means it was never officially part of the API. Maybe you were working with a pre-release version, and the API got changed?

The functionality you're looking for seems to be in the java.nio.file.Files class.
 
Dayo Daniel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much.. just as you suggested i was working with the beta version before.. but i was able to fix it now .. Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic