@@ -17,13 +17,13 @@ #include #include #include -#import "OFEmbeddedFileURLHandler.h" +#import "OFEmbeddedURIHandler.h" #import "OFMemoryStream.h" -#import "OFURL.h" +#import "OFURI.h" #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" #ifdef OF_HAVE_THREADS @@ -69,26 +69,26 @@ #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexUnlock(&mutex) == 0); #endif } -@implementation OFEmbeddedFileURLHandler -- (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode +@implementation OFEmbeddedURIHandler +- (OFStream *)openItemAtURI: (OFURI *)URI mode: (OFString *)mode { const char *path; - if (![URL.scheme isEqual: @"objfw-embedded"] || URL.host != nil || - URL.port != nil || URL.user != nil || URL.password != nil || - URL.query != nil || URL.fragment != nil) + if (![URI.scheme isEqual: @"objfw-embedded"] || URI.host != nil || + URI.port != nil || URI.user != nil || URI.password != nil || + URI.query != nil || URI.fragment != nil) @throw [OFInvalidArgumentException exception]; if (![mode isEqual: @"r"]) - @throw [OFOpenItemFailedException exceptionWithURL: URL + @throw [OFOpenItemFailedException exceptionWithURI: URI mode: mode errNo: EROFS]; - if ((path = URL.path.UTF8String) == NULL) { + if ((path = URI.path.UTF8String) == NULL) { @throw [OFInvalidArgumentException exception]; } #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexLock(&mutex) == 0); @@ -108,10 +108,10 @@ } @finally { OFEnsure(OFPlainMutexUnlock(&mutex) == 0); } #endif - @throw [OFOpenItemFailedException exceptionWithURL: URL + @throw [OFOpenItemFailedException exceptionWithURI: URI mode: mode errNo: ENOENT]; } @end