• 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

return Directory name and path from a folder

 
Ranch Hand
Posts: 66
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


i am making a movie application.... i want to know how do i create a method that returns

the directory name and its path to a Map object........



i am going to provide the specified path of my movie directory from my hardisk to it....


please provide me some example code if possible



thank you
 
Ranch Hand
Posts: 233
1
Eclipse IDE Opera Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.io.File has methods to get details you sought.
Then you can create a method that creates a java.util.Map object with these two details, and then specify the return type of that method as Map itself.
Then you have your issue resolved!!

Regards,
 
abrar alvi
Ranch Hand
Posts: 66
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rajdeep Biswas wrote:java.io.File has methods to get details you sought.
Then you can create a method that creates a java.util.Map object with these two details, and then specify the return type of that method as Map itself.
Then you have your issue resolved!!

Regards,




thank you Rajdeep.... can you give me some good examples links....
 
Rancher
Posts: 1776
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abrar alvi wrote:can you give me some good examples links....


Rajdeep's post already has auto-links for File and Map Java APIs. Try clicking these - java.io.File and java.util.Map
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic