Skip to content

[NSURL] Implementation of '.checkResourceIsReachable' #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 6, 2017

Conversation

naithar
Copy link
Contributor

@naithar naithar commented Mar 3, 2017

Implemented and renamed method for NSURL to match Darwin's version.
Added method . checkResourceIsReachable to URL that matches Darwin's Foundation.

Sergey Minakov added 5 commits March 3, 2017 11:42
…ourceIsReachableAndReturnError' for 'NSURL' to match Darwin's Foundation. 'NSURL' does not throw on darwin by sets the error pointer that is passed in parameter.
Use correct initializer in test
@naithar naithar force-pushed the nsurl-checkReachable branch from 86e26ee to 086d130 Compare March 3, 2017 09:04
@@ -610,8 +610,28 @@ open class NSURL : NSObject, NSSecureCoding, NSCopying {
*/
/// - Experiment: This is a draft API currently under consideration for official import into Foundation as a suitable alternative
/// - Note: Since this API is under consideration it may be either removed or revised in the near future
open func checkResourceIsReachable() throws -> Bool {
NSUnimplemented()
open func checkResourceIsReachableAndReturnError(_ error: UnsafeMutablePointer<NSError?>?) -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you put back the error argument here for compatibility with Darwin? There it's an autoreleased error, which we don't have on Linux. For this method I'm ok with the divergent API for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did it for compatibility with Darwin. I didn't know about the issue (i guess i've just missed it). I'll revert this change.

…ceIsReachable' with throw as Linux does not support Autoreleasing pointers
@naithar
Copy link
Contributor Author

naithar commented Mar 6, 2017

Updated NSURL class. @parkera please review.

@parkera
Copy link
Contributor

parkera commented Mar 6, 2017

@swift-ci please test and merge

@naithar
Copy link
Contributor Author

naithar commented Mar 6, 2017

"ninja: error: unknown target 'swift-benchmark-linux-x86_64"
Seems like unrelated issue.

@parkera
Copy link
Contributor

parkera commented Mar 6, 2017

@shahmishal @erg do you know what that error means?

@shahmishal
Copy link
Member

This PR should fix this issue swiftlang/swift#7931

@parkera
Copy link
Contributor

parkera commented Mar 6, 2017

@swift-ci please test and merge

@swift-ci swift-ci merged commit 3c737c9 into swiftlang:master Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants