What is the difference between standardized URL and URL.absoluteURL?

In the class of Swift URLthere .standardizedand .absoluteURL( .standardizedURLand .absoluteURLand .URLByStandardizingPathin Objective-C NSURL). There also .standardizedFileURL.

I have no idea what the difference is between all of these, but there must be one, since they provide all of them, right? I mean, it is .standardizedFileURLintended only for processing file URLs, but other than that (for example, if everyone is called by file URL), what's the difference?


From the above documents:

Swift

standardized

Returns the URL with any instances of ".." or ".". removed from his path.

absolute url

Returns an absolute URL.

Discussion

If the URL itself is absolute, it will return self.

URL

URL- .

is​File​URL - false, self.

Objective-C

URL

URL- ".." ".". . ( )

NSURL, , ".." ".". RFC 1808, nil.

URL

URL-, , . ( )

URL- , . RFC 1808.

URLBy

URL, , URL, . ( )

URL- : . URL- URL-.

string​By​Standardizing​Path, URL:

, string​By​Expanding​Tilde​In​Path. ( "//" "/./" ) . ( ".." ) , , string​By​Resolving​Symlinks​In​Path, .

, , . "/private" , ( ).

, , , . , ( , , URL-).

+4

Source: https://habr.com/ru/post/1674216/


All Articles