In Java can I create a URI for a file located locally in the hard drive? If so, how should it be constructed?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look at File documentation:
File has a constructor, which takes URI as a parameter, and it also has method
toURI()if you want to get URI from existing file. You can play with that to understand how the things should be done.You can also read about URI (it’s not a java term). There is an example in Wikipedia: