Skip to content

Commit

Permalink
Merge pull request #10 from Azure/dev
Browse files Browse the repository at this point in the history
v0.1.1 release
  • Loading branch information
asorrin-msft committed Dec 7, 2015
2 parents f4f8d3e + a6e44d4 commit d5bc5f7
Show file tree
Hide file tree
Showing 34 changed files with 321 additions and 183 deletions.
13 changes: 10 additions & 3 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
MIT License
Copyright (c) 2015 Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
B082D17B1BAA962700A39C18 /* Multiplatform Build */,
);
dependencies = (
B082D17A1BAA961700A39C18 /* PBXTargetDependency */,
);
name = Framework;
productName = Framework;
Expand Down Expand Up @@ -92,7 +91,6 @@
B082D1971BB0D2DE00A39C18 /* AZSRetryPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = B058A4921B4F518C00BB0F57 /* AZSRetryPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; };
B0C0F5E81B44C8FC0080DC49 /* AZSResponseParser.m in Sources */ = {isa = PBXBuildFile; fileRef = B0C0F5E71B44C8FC0080DC49 /* AZSResponseParser.m */; };
BE4510441A9D252300C3F971 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE4510431A9D252300C3F971 /* Foundation.framework */; };
BE4510491A9D252300C3F971 /* Azure_Storage_Client_Library.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BE4510481A9D252300C3F971 /* Azure_Storage_Client_Library.h */; };
BE45104B1A9D252300C3F971 /* Azure_Storage_Client_Library.m in Sources */ = {isa = PBXBuildFile; fileRef = BE45104A1A9D252300C3F971 /* Azure_Storage_Client_Library.m */; };
BE4510521A9D252300C3F971 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE4510511A9D252300C3F971 /* XCTest.framework */; };
BE4510531A9D252300C3F971 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE4510431A9D252300C3F971 /* Foundation.framework */; };
Expand All @@ -118,13 +116,6 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
B082D1791BAA961700A39C18 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BE4510381A9D252300C3F971 /* Project object */;
proxyType = 1;
remoteGlobalIDString = BE45103F1A9D252300C3F971;
remoteInfo = "Azure Storage Client Library";
};
BE4510561A9D252300C3F971 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BE4510381A9D252300C3F971 /* Project object */;
Expand All @@ -134,19 +125,6 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
BE45103E1A9D252300C3F971 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
BE4510491A9D252300C3F971 /* Azure_Storage_Client_Library.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
69FF6EBE1B83C56200AF4FDE /* AZSLeaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AZSLeaseTests.m; sourceTree = "<group>"; };
B01733FF1B0A59BE00E5807C /* AZSCloudBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AZSCloudBlob.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -229,7 +207,7 @@
BE4510471A9D252300C3F971 /* Azure Storage Client Library-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Azure Storage Client Library-Prefix.pch"; sourceTree = "<group>"; };
BE4510481A9D252300C3F971 /* Azure_Storage_Client_Library.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Azure_Storage_Client_Library.h; sourceTree = "<group>"; };
BE45104A1A9D252300C3F971 /* Azure_Storage_Client_Library.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Azure_Storage_Client_Library.m; sourceTree = "<group>"; };
BE4510501A9D252300C3F971 /* Azure Storage Client LibraryTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Azure Storage Client LibraryTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
BE4510501A9D252300C3F971 /* Azure Storage Client Library.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Azure Storage Client Library.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
BE4510511A9D252300C3F971 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
BE4510541A9D252300C3F971 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
BE45105B1A9D252300C3F971 /* Azure Storage Client LibraryTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Azure Storage Client LibraryTests-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -367,7 +345,7 @@
isa = PBXGroup;
children = (
BE4510401A9D252300C3F971 /* libAzure Storage Client Library.a */,
BE4510501A9D252300C3F971 /* Azure Storage Client LibraryTests.xctest */,
BE4510501A9D252300C3F971 /* Azure Storage Client Library.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -548,7 +526,7 @@
);
name = "Azure Storage Client LibraryTests";
productName = "Azure Storage Client LibraryTests";
productReference = BE4510501A9D252300C3F971 /* Azure Storage Client LibraryTests.xctest */;
productReference = BE4510501A9D252300C3F971 /* Azure Storage Client Library.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
Expand All @@ -558,7 +536,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = AZS;
LastUpgradeCheck = 0630;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = Microsoft;
};
buildConfigurationList = BE45103B1A9D252300C3F971 /* Build configuration list for PBXProject "Azure Storage Client Library" */;
Expand Down Expand Up @@ -698,11 +676,6 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
B082D17A1BAA961700A39C18 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BE45103F1A9D252300C3F971 /* Azure Storage Client Library */;
targetProxy = B082D1791BAA961700A39C18 /* PBXContainerItemProxy */;
};
BE4510571A9D252300C3F971 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BE45103F1A9D252300C3F971 /* Azure Storage Client Library */;
Expand Down Expand Up @@ -753,6 +726,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -817,7 +791,6 @@
BE4510641A9D252300C3F971 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
DEAD_CODE_STRIPPING = NO;
DSTROOT = /tmp/Azure_Storage_Client_Library.dst;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
Expand All @@ -828,9 +801,10 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = "Azure Storage Client Library";
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)";
SKIP_INSTALL = YES;
STRIP_STYLE = "non-global";
Expand All @@ -841,7 +815,6 @@
BE4510651A9D252300C3F971 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = NO;
DSTROOT = /tmp/Azure_Storage_Client_Library.dst;
Expand All @@ -853,9 +826,10 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = "Azure Storage Client Library";
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)";
SKIP_INSTALL = YES;
STRIP_STYLE = "non-global";
Expand All @@ -878,7 +852,9 @@
"$(inherited)",
);
INFOPLIST_FILE = "Azure Storage Client LibraryTests/Azure Storage Client LibraryTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_BUNDLE_IDENTIFIER = "MS.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "Azure Storage Client Library";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
Expand All @@ -887,7 +863,6 @@
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ AZS_ASSUME_NONNULL_BEGIN
@param eTag The ETag that must match on the service; otherwise the request will fail.
*/
-(instancetype) initWithIfMatchCondition:(NSString*)eTag AZS_DESIGNATED_INITIALIZER;
-(instancetype) initWithIfMatchCondition:(NSString* __AZSNullable)eTag AZS_DESIGNATED_INITIALIZER;

/** Initialize a new AZSAccessCondition object with a 'If-None-Match' condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@
#import "AZSAccessCondition.h"
#import "AZSUtil.h"

@interface AZSAccessCondition()

-(instancetype)init AZS_DESIGNATED_INITIALIZER;

@end

@implementation AZSAccessCondition

-(instancetype) init
{
self = [super init];

return self;
return nil;
}

-(instancetype) initWithIfMatchCondition:(NSString*)eTag
{
self = [self init];
self = [super init];
if (self)
{
_ifMatchETag = eTag;
Expand All @@ -40,7 +44,7 @@ -(instancetype) initWithIfMatchCondition:(NSString*)eTag

-(instancetype) initWithIfNoneMatchCondition:(NSString*)eTag
{
self = [self init];
self = [super init];
if (self)
{
_ifNoneMatchETag = eTag;
Expand All @@ -51,7 +55,7 @@ -(instancetype) initWithIfNoneMatchCondition:(NSString*)eTag

-(instancetype) initWithIfModifiedSinceCondition:(NSDate*)modifiedDate
{
self = [self init];
self = [super init];
if (self)
{
_ifModifiedSinceDate = modifiedDate;
Expand All @@ -62,7 +66,7 @@ -(instancetype) initWithIfModifiedSinceCondition:(NSDate*)modifiedDate

-(instancetype) initWithIfNotModifiedSinceCondition:(NSDate*)modifiedDate
{
self = [self init];
self = [super init];
if (self)
{
_ifNotModifiedSinceDate = modifiedDate;
Expand All @@ -73,7 +77,7 @@ -(instancetype) initWithIfNotModifiedSinceCondition:(NSDate*)modifiedDate

-(instancetype) initWithLeaseId:(NSString*)leaseId
{
self = [self init];
self = [super init];
if (self)
{
_leaseId = leaseId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@ AZS_ASSUME_NONNULL_BEGIN
// NSStreamDelegate:
- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;


// Specific blob methods:
-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext AZS_DESIGNATED_INITIALIZER;


@end

AZS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ @interface AZSBlobOutputStream()
@property BOOL hasStreamErrorEventFired;
@property (strong) AZSBlobUploadHelper *blobUploadHelper;

// This method should never be called. It is only here to comply with subclassing requirements.
-(instancetype)initToMemory AZS_DESIGNATED_INITIALIZER;

// This method should never be called. It is only here to comply with subclassing requirements.
-(instancetype)initToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity AZS_DESIGNATED_INITIALIZER;

// This method should never be called. It is only here to comply with subclassing requirements.
-(instancetype)initWithURL:(NSURL *)url append:(BOOL)shouldAppend AZS_DESIGNATED_INITIALIZER;


@end

Expand Down Expand Up @@ -113,9 +122,29 @@ @implementation AZSBlobOutputStream
@synthesize delegate = _delegate;
@synthesize hasSpaceAvailable = _hasSpaceAvailable;

-(instancetype)initToMemory
{
self = [super initToMemory];
return nil;
}

-(instancetype)initToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity
{
self = [super initToBuffer:buffer capacity:0];
return nil;
}

-(instancetype)initWithURL:(NSURL *)url append:(BOOL)shouldAppend
{
self = [super initWithURL:url append:NO];
return nil;
}

-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSAccessCondition *)accessCondition requestOptions:(AZSBlobRequestOptions *)requestOptions operationContext:(AZSOperationContext *)operationContext
{
self = [super init];
// A designated initializer must make a super call to a designated initializer of the super class.
uint8_t temp;
self = [super initToBuffer:&temp capacity:0];
if (self)
{
_blobUploadHelper = [[AZSBlobUploadHelper alloc] initToBlockBlob:blockBlob accessCondition:accessCondition requestOptions:requestOptions operationContext:operationContext completionHandler:nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ -(instancetype)init
@end

@implementation AZSBlobListItem

-(instancetype)init
{
self = [super init];
Expand Down Expand Up @@ -476,7 +477,7 @@ +(NSArray *) parseGetBlockListResponseWithData:(NSData *)data operationContext:(
parser.shouldProcessNamespaces = NO;

__block NSMutableArray *blockList = [NSMutableArray arrayWithCapacity:10];
__block AZSBlockListItem *currentBlock = [[AZSBlockListItem alloc] init];
__block AZSBlockListItem *currentBlock = [[AZSBlockListItem alloc] initWithBlockID:@"" blockListMode:AZSBlockListModeLatest];
__block NSMutableArray *elementStack = [NSMutableArray arrayWithCapacity:10];
__block NSMutableString *builder = [[NSMutableString alloc] init];

Expand Down Expand Up @@ -520,13 +521,13 @@ +(NSArray *) parseGetBlockListResponseWithData:(NSData *)data operationContext:(
{
currentBlock.blockListMode = AZSBlockListModeCommitted;
[blockList addObject:currentBlock];
currentBlock = [[AZSBlockListItem alloc] init];
currentBlock = [[AZSBlockListItem alloc] initWithBlockID:@"" blockListMode:AZSBlockListModeLatest];
}
else if ([parentNode isEqualToString:@"UncommittedBlocks"])
{
currentBlock.blockListMode = AZSBlockListModeUncommitted;
[blockList addObject:currentBlock];
currentBlock = [[AZSBlockListItem alloc] init];
currentBlock = [[AZSBlockListItem alloc] initWithBlockID:@"" blockListMode:AZSBlockListModeLatest];
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AZS_ASSUME_NONNULL_BEGIN
@property (strong) AZSOperationContext *operationContext;
@property (strong) NSError *streamingError;

-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void (^)(NSError* __AZSNullable))completionHandler AZS_DESIGNATED_INITIALIZER;
-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSNullable AZSAccessCondition *)accessCondition requestOptions:(AZSNullable AZSBlobRequestOptions *)requestOptions operationContext:(AZSNullable AZSOperationContext *)operationContext completionHandler:(void (^ __AZSNullable)(NSError* __AZSNullable))completionHandler AZS_DESIGNATED_INITIALIZER;
-(NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length completionHandler:(void(^)())completionHandler;
-(BOOL)closeWithCompletionHandler:(void(^)())completionHandler;
-(BOOL)hasSpaceAvailable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,22 @@ @interface AZSBlobUploadHelper()
@property (copy) void (^completionHandler)(NSError*);


@end

@interface AZSBlobUploadHelper()

-(instancetype)init AZS_DESIGNATED_INITIALIZER;

@end

@implementation AZSBlobUploadHelper

-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSAccessCondition *)accessCondition requestOptions:(AZSBlobRequestOptions *)requestOptions operationContext:(AZSOperationContext *)operationContext completionHandler:(void (^)(NSError*))completionHandler
-(instancetype)init
{
return nil;
}

-(instancetype)initToBlockBlob:(AZSCloudBlockBlob *)blockBlob accessCondition:(AZSAccessCondition *)accessCondition requestOptions:(AZSBlobRequestOptions *)requestOptions operationContext:(AZSOperationContext *)operationContext completionHandler:(void (^ __AZSNullable)(NSError*))completionHandler
{
self = [super init];
if (self)
Expand Down
Loading

0 comments on commit d5bc5f7

Please sign in to comment.