@@ -12,6 +12,8 @@ var storjEncryption: String = "change-me-to-desired-encryptionphassphrase"
12
12
var storjBucket : String = " change-me-to-desired-bucket-name "
13
13
// Upload path within the bucket, where file will be uploaded.
14
14
var storjUploadPath : String = " path/filename.txt "
15
+ // Upload path within the bucket, where file will be uploaded via overridden serialized access key
16
+ var storjUploadPath2 : String = " path/filename2.txt "
15
17
// Download path within the bucket, wherefrom the Storj object is to be downloaded.
16
18
var storjDownloadPath : String = " path/filename.txt "
17
19
// Full file name, including path, of the local system, to be uploaded to Storj bucket.
32
34
//
33
35
let uplink = try Storj . uplink ( )
34
36
//
35
- print ( " Getting Accessig using : \n Satellite address : \( storjSatellite) \n API key : \( storjApiKey) \n Encryption phassphrase : \( storjEncryption) " )
37
+ print ( " Getting Access using : \n Satellite address : \( storjSatellite) \n API key : \( storjApiKey) \n Encryption phassphrase : \( storjEncryption) " )
36
38
//
37
39
let access = try uplink. request_Access_With_Passphrase ( satellite: storjSatellite, apiKey: storjApiKey, encryption: storjEncryption)
38
40
//
92
94
//
93
95
downloadObject ( project: & project, bucketName: storjBucket, localFullFileLocationToStore: localFullFileLocationToStore, storjDownloadPath: storjDownloadPath)
94
96
//
95
- var listObjectsOptions = ListObjectsOptions ( prefix: " change-me-to-desired-prefix-with-/ " , cursor: " " , recursive: true , system: false , custom: true )
97
+ var listObjectsOptions = ListObjectsOptions ( prefix: " change-me-to-desired-prefix-with-/ " , cursor: " " , recursive: true , system: true , custom: true )
96
98
//
97
99
let objectslist = try project. list_Objects ( bucket: storjBucket, listObjectsOptions: & listObjectsOptions)
98
100
print ( " \n List object " )
99
101
for object in objectslist {
100
102
print ( " Object Name : \( object. key) " )
101
103
print ( " Object Size : \( object. system. content_length) " )
102
104
}
105
+ //Deleting Object
106
+ let deletedObject = try project. delete_Object ( bucket: storjBucket, key: storjUploadPath)
107
+ print ( " \n Object deleted !! " )
108
+ print ( " Object Information : " )
109
+ print ( " Object Name : \( deletedObject. key) " )
110
+ print ( " Object Size : \( deletedObject. system. content_length) " )
103
111
//
104
112
print ( " \n Creating share access " )
105
113
//
@@ -148,19 +156,24 @@ do {
148
156
}
149
157
}
150
158
//
151
- //Deleting Object
152
- let deletedObject = try projectparsed. delete_Object ( bucket: storjBucket, key: storjUploadPath)
159
+ print ( " \n Uploading object on storj V3 network via overridden serialized access... " )
160
+ //
161
+ uploadObject ( project: projectparsed, bucketName: storjBucket, localFullFileNameToUpload: localFullFileNameToUpload, storjUploadPath: storjUploadPath2)
162
+ //
163
+ //Deleting Object uploaded via overridden serialized access
164
+ let deletedObject2 = try projectparsed. delete_Object ( bucket: storjBucket, key: storjUploadPath2)
153
165
print ( " \n Object deleted !! " )
154
166
print ( " Object Information : " )
155
- print ( " Object Name : \( deletedObject . key) " )
156
- print ( " Object Size : \( deletedObject . system. content_length) " )
167
+ print ( " Object Name : \( deletedObject2 . key) " )
168
+ print ( " Object Size : \( deletedObject2 . system. content_length) " )
157
169
//Deleting bucket
158
170
let deleteBucket = try project. delete_Bucket ( bucket: storjBucket)
159
171
//
160
172
print ( " \n Bucket deleted!! " )
161
173
print ( " Bucket information : \n Bucket created : " , unixTimeConvert ( unixTime: deleteBucket. created) )
162
174
print ( " Bucket name : " , deleteBucket. name)
163
175
//
176
+ //
164
177
} catch let error as InternalError {
165
178
print ( " Internal SO error " )
166
179
print ( " Error Code : \( error. code) " )
0 commit comments