Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Universal Pathname Form (was Re: Finding all mounted volumes)



Greg Guerin <email@hidden> wrote:

By the way, the closest thing I can think of to a universal pathname form
is a URL. But File.toURL() may not cut it, because it will encode the host
platform's idea of a URL, which is not the same as a portable URL. That
is, move the media to another platform and the URL may be different. This
shouldn't be too surprising, since URL's were never intended for doing this.


Actually, that would be a URI, which doesn't cut it either.
<http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html>
Not that we could use it yet anyway :)


<http://java.sun.com/j2se/1.4/docs/api/java/io/File.html#toURI()> says:

For a given abstract pathname f, it is guaranteed that

new File( f.toURI()).equals( f)

so long as the original abstract pathname, the URI, and the new
abstract pathname are all created in (possibly different invocations
of) the same Java virtual machine. Due to the system-dependent nature
of abstract pathnames, however, this relationship typically does not
hold when a file: URI that is created in a virtual machine on one
operating system is converted into an abstract pathname in a virtual
machine on a different operating system.

--
----------------------------------------------------------
Out of the 10Base-T, through the router, down the T1, over the
leased line, off the bridge, past the firewall... nothing but Net.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Finding all mounted volumes (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.