About Question enthuware.ocpjp.v7.2.1603 :
Moderator: admin
-
- Posts: 8
- Joined: Wed Mar 16, 2016 10:57 am
- Contact:
About Question enthuware.ocpjp.v7.2.1603 :
Hi,
I understand everything about this question except one thing.
Where does "file:///" come from?
When I looked at the toUri() method in the java api it said:
"This method constructs an absolute URI with a scheme equal to the URI scheme that identifies the provider. The exact form of the scheme specific part is highly provider dependent."
So isn't it possible this won't start with "file:///"?
I understand everything about this question except one thing.
Where does "file:///" come from?
When I looked at the toUri() method in the java api it said:
"This method constructs an absolute URI with a scheme equal to the URI scheme that identifies the provider. The exact form of the scheme specific part is highly provider dependent."
So isn't it possible this won't start with "file:///"?
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
It is certainly possible that it won't start with file:///. But no other options are given so it is ok to assume that on this particular system it will start with file:/// (if there is no exception, of course).
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 25
- Joined: Thu Jun 01, 2017 2:50 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
Re the quote from the API “... an empty path is returned if this path does have a root component and all name elements are redundant" I tried this and do see the root e.g.
Path p1 = Paths.get("c:/x/../y/../z/..");
System.out.println(p1.normalize());
prints "c:" not "" (nothing).
Do you think this might be a typo in the API? Maybe it should read "... does not have a root component ...”?
Path p1 = Paths.get("c:/x/../y/../z/..");
System.out.println(p1.normalize());
prints "c:" not "" (nothing).
Do you think this might be a typo in the API? Maybe it should read "... does not have a root component ...”?
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
Can you please post the link where you saw this written?
If you like our products and services, please help us by posting your review here.
-
- Posts: 25
- Joined: Thu Jun 01, 2017 2:50 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
The "Returns" section of the full method description in https://docs.oracle.com/javase/7/docs/a ... /Path.html
Same in the descriptive comment in the source code file as seen via NetBeans (Navigate > Go to Source)
(And then reproduced in the Explanation for this Enthuware Q)
Same in the descriptive comment in the source code file as seen via NetBeans (Navigate > Go to Source)
(And then reproduced in the Explanation for this Enthuware Q)
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
I see. Yes, it could be a typo.
If you like our products and services, please help us by posting your review here.
-
- Posts: 25
- Joined: Thu Jun 01, 2017 2:50 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1603 :
Thanks - good to have an opinion from a much more knowledgable source
Who is online
Users browsing this forum: No registered users and 56 guests