root / pithos-macos / PithosUtilities.h @ 1b1e6fa1
History | View | Annotate | Download (9.1 kB)
1 |
//
|
---|---|
2 |
// PithosFileUtilities.h
|
3 |
// pithos-macos
|
4 |
//
|
5 |
// Copyright 2011 GRNET S.A. All rights reserved.
|
6 |
//
|
7 |
// Redistribution and use in source and binary forms, with or
|
8 |
// without modification, are permitted provided that the following
|
9 |
// conditions are met:
|
10 |
//
|
11 |
// 1. Redistributions of source code must retain the above
|
12 |
// copyright notice, this list of conditions and the following
|
13 |
// disclaimer.
|
14 |
//
|
15 |
// 2. Redistributions in binary form must reproduce the above
|
16 |
// copyright notice, this list of conditions and the following
|
17 |
// disclaimer in the documentation and/or other materials
|
18 |
// provided with the distribution.
|
19 |
//
|
20 |
// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
21 |
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
22 |
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
23 |
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
24 |
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25 |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26 |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
27 |
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
28 |
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
29 |
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
30 |
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
// POSSIBILITY OF SUCH DAMAGE.
|
32 |
//
|
33 |
// The views and conclusions contained in the software and
|
34 |
// documentation are those of the authors and should not be
|
35 |
// interpreted as representing official policies, either expressed
|
36 |
// or implied, of GRNET S.A.
|
37 |
|
38 |
@class ASIPithosRequest;
|
39 |
@class ASIPithosContainerRequest;
|
40 |
@class ASIPithosObjectRequest;
|
41 |
|
42 |
@interface PithosUtilities : NSObject
|
43 |
|
44 |
+ (ASIPithosObjectRequest *)objectDataRequestWithContainerName:(NSString *)containerName |
45 |
objectName:(NSString *)objectName |
46 |
toDirectory:(NSString *)directoryPath |
47 |
checkIfExists:(BOOL)ifExists |
48 |
sharingAccount:(NSString *)sharingAccount; |
49 |
+ (NSArray *)objectDataRequestsForSubdirWithContainerName:(NSString *)containerName |
50 |
objectName:(NSString *)objectName |
51 |
toDirectory:(NSString *)directoryPath |
52 |
checkIfExists:(BOOL)ifExists |
53 |
sharingAccount:(NSString *)sharingAccount; |
54 |
|
55 |
+ (ASIPithosObjectRequest *)writeObjectDataRequestWithContainerName:(NSString *)containerName |
56 |
objectName:(NSString *)objectName |
57 |
contentType:(NSString *)contentType |
58 |
blockSize:(NSUInteger)blockSize |
59 |
blockHash:(NSString *)blockHash |
60 |
forFile:(NSString *)filePath |
61 |
checkIfExists:(BOOL)ifExists |
62 |
hashes:(NSArray **)hashes |
63 |
sharingAccount:(NSString *)sharingAccount; |
64 |
+ (NSIndexSet *)missingBlocksForHashes:(NSArray *)hashes withMissingHashesResponse:(NSString *)missingHashesResponse; |
65 |
+ (ASIPithosContainerRequest *)updateContainerDataRequestWithContainerName:(NSString *)containerName |
66 |
blockSize:(NSUInteger)blockSize |
67 |
forFile:(NSString *)filePath |
68 |
hashes:(NSArray *)hashes |
69 |
missingHashesResponse:(NSString *)missingHashesResponse |
70 |
sharingAccount:(NSString *)sharingAccount; |
71 |
+ (ASIPithosContainerRequest *)updateContainerDataRequestWithContainerName:(NSString *)containerName |
72 |
blockSize:(NSUInteger)blockSize |
73 |
forFile:(NSString *)filePath |
74 |
missingBlockIndex:(NSUInteger)missingBlockIndex |
75 |
sharingAccount:(NSString *)sharingAccount; |
76 |
+ (NSArray *)writeObjectDataRequestsWithContainerName:(NSString *)containerName |
77 |
objectName:(NSString *)objectName |
78 |
blockSize:(NSUInteger)blockSize |
79 |
blockHash:(NSString *)blockHash |
80 |
forDirectory:(NSString *)directoryPath |
81 |
checkIfExists:(BOOL)ifExists |
82 |
objectNames:(NSMutableArray **)objectNames |
83 |
contentTypes:(NSMutableArray **)contentTypes |
84 |
filePaths:(NSMutableArray **)filePaths |
85 |
hashesArrays:(NSMutableArray **)hashesArrays |
86 |
directoryObjectRequests:(NSMutableArray **) directoryObjectRequests |
87 |
sharingAccount:(NSString *)sharingAccount; |
88 |
|
89 |
+ (NSArray *)deleteObjectRequestsForSubdirWithContainerName:(NSString *)containerName objectName:(NSString *)objectName; |
90 |
|
91 |
+ (ASIPithosObjectRequest *)copyObjectRequestWithContainerName:(NSString *)containerName |
92 |
objectName:(NSString *)objectName |
93 |
destinationContainerName:(NSString *)destinationContainerName |
94 |
destinationObjectName:(NSString *)destinationObjectName |
95 |
checkIfExists:(BOOL)ifExists |
96 |
sharingAccount:(NSString *)sharingAccount; |
97 |
+ (NSArray *)copyObjectRequestsForSubdirWithContainerName:(NSString *)containerName |
98 |
objectName:(NSString *)objectName |
99 |
destinationContainerName:(NSString *)destinationContainerName |
100 |
destinationObjectName:(NSString *)destinationObjectName |
101 |
checkIfExists:(BOOL)ifExists |
102 |
sharingAccount:(NSString *)sharingAccount; |
103 |
|
104 |
|
105 |
+ (ASIPithosObjectRequest *)moveObjectRequestWithContainerName:(NSString *)containerName |
106 |
objectName:(NSString *)objectName |
107 |
destinationContainerName:(NSString *)destinationContainerName |
108 |
destinationObjectName:(NSString *)destinationObjectName |
109 |
checkIfExists:(BOOL)ifExists; |
110 |
+ (NSArray *)moveObjectRequestsForSubdirWithContainerName:(NSString *)containerName |
111 |
objectName:(NSString *)objectName |
112 |
destinationContainerName:(NSString *)destinationContainerName |
113 |
destinationObjectName:(NSString *)destinationObjectName |
114 |
checkIfExists:(BOOL)ifExists; |
115 |
|
116 |
+ (NSUInteger)bytesOfFile:(NSString *)filePath; |
117 |
+ (NSString *)contentTypeOfFile:(NSString *)filePath error:(NSError **)error; |
118 |
+ (BOOL)objectExistsAtContainerName:(NSString *)containerName objectName:(NSString *)objectName |
119 |
error:(NSError **)error isDirectory:(BOOL *)isDirectory sharingAccount:(NSString *)sharingAccount; |
120 |
+ (BOOL)proceedIfObjectExistsAtContainerName:(NSString *)containerName objectName:(NSString *)objectName |
121 |
sharingAccount:(NSString *)sharingAccount; |
122 |
+ (NSArray *)objectsWithContainerName:(NSString *)containerName objectNamePrefix:(NSString *)objectNamePrefix |
123 |
delimiter:(NSString *)delimiter sharingAccount:(NSString *)sharingAccount; |
124 |
+ (NSArray *)objectsForSubdirWithContainerName:(NSString *)containerName objectName:(NSString *)objectName |
125 |
delimiter:(NSString *)delimiter sharingAccount:(NSString *)sharingAccount; |
126 |
+ (NSString *)safeObjectNameForContainerName:(NSString *)containerName objectName:(NSString *)objectName; |
127 |
+ (NSString *)safeSubdirNameForContainerName:(NSString *)containerName subdirName:(NSString *)subdirName; |
128 |
|
129 |
+ (NSInteger)httpRequestErrorAlertWithRequest:(ASIPithosRequest *)request; |
130 |
+ (NSInteger)unexpectedResponseStatusAlertWithRequest:(ASIPithosRequest *)request; |
131 |
|
132 |
+ (ASIPithosRequest *)prepareRequest:(ASIPithosRequest *)request priority:(NSOperationQueuePriority)priority; |
133 |
+ (ASIPithosRequest *)prepareRequest:(ASIPithosRequest *)request; |
134 |
+ (ASIPithosRequest *)copyRequest:(ASIPithosRequest *)request; |
135 |
|
136 |
@end
|