@@ -16,38 +16,39 @@ #include "config.h" #import "OFCreateDirectoryFailedException.h" #import "OFString.h" +#import "OFURL.h" @implementation OFCreateDirectoryFailedException -@synthesize path = _path, errNo = _errNo; +@synthesize URL = _URL, errNo = _errNo; + (instancetype)exception { OF_UNRECOGNIZED_SELECTOR } -+ (instancetype)exceptionWithPath: (OFString *)path ++ (instancetype)exceptionWithURL: (OFURL *)URL errNo: (int)errNo { - return [[[self alloc] initWithPath: path - errNo: errNo] autorelease]; + return [[[self alloc] initWithURL: URL + errNo: errNo] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)initWithPath: (OFString *)path - errNo: (int)errNo +- (instancetype)initWithURL: (OFURL *)URL + errNo: (int)errNo { self = [super init]; @try { - _path = [path copy]; + _URL = [URL copy]; _errNo = errNo; } @catch (id e) { [self release]; @throw e; } @@ -55,17 +56,16 @@ return self; } - (void)dealloc { - [_path release]; + [_URL release]; [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: - @"Failed to create directory %@: %@", - _path, of_strerror(_errNo)]; + @"Failed to create directory %@: %@", _URL, of_strerror(_errNo)]; } @end