Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

return Directory name and path from a folder  RSS feed

 
abrar alvi
Ranch Hand
Posts: 66
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
Rajdeep Biswas
Ranch Hand
Posts: 231
1
Eclipse IDE Java Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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....
 
John Jai
Rancher
Posts: 1776
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!