Index: trunk/extensions/WindowsAzureStorage/includes/filerepo/backend/WindowsAzureFileBackend.php |
— | — | @@ -74,11 +74,12 @@ |
75 | 75 | return $status; |
76 | 76 | } |
77 | 77 | |
78 | | - // Check if the destination object already exists |
79 | | - $blobExists = $this->storageClient->blobExists( $dstCont, $dstRel ); |
80 | | - if ( $blobExists && empty( $params['overwrite'] ) ) { //Blob exists _and_ should not be overridden |
81 | | - $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
82 | | - return $status; |
| 78 | + if ( empty( $params['overwrite'] ) ) { //Blob should not be overridden |
| 79 | + // Check if the destination object already exists |
| 80 | + if ( $this->storageClient->blobExists( $dstCont, $dstRel ) ) { |
| 81 | + $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
| 82 | + return $status; |
| 83 | + } |
83 | 84 | } |
84 | 85 | |
85 | 86 | try { |
— | — | @@ -106,10 +107,11 @@ |
107 | 108 | return $status; |
108 | 109 | } |
109 | 110 | |
110 | | - $blobExists = $this->storageClient->blobExists( $dstContainer, $dstDir ); |
111 | | - if ( $blobExists && empty( $params['overwrite'] ) ) { //Blob exists _and_ should not be overridden |
112 | | - $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
113 | | - return $status; |
| 111 | + if ( empty( $params['overwrite'] ) ) { //Blob should not be overridden |
| 112 | + if ( $this->storageClient->blobExists( $dstContainer, $dstDir ) ) { |
| 113 | + $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
| 114 | + return $status; |
| 115 | + } |
114 | 116 | } |
115 | 117 | |
116 | 118 | try { |
— | — | @@ -165,11 +167,12 @@ |
166 | 168 | return $status; |
167 | 169 | } |
168 | 170 | |
169 | | - // Check if the destination object already exists |
170 | | - $blobExists = $this->storageClient->blobExists( $dstCont, $dstRel ); |
171 | | - if ( $blobExists && empty( $params['overwrite'] ) ) { //Blob exists _and_ should not be overridden |
172 | | - $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
173 | | - return $status; |
| 171 | + if ( empty( $params['overwrite'] ) ) { //Blob should not be overridden |
| 172 | + // Check if the destination object already exists |
| 173 | + if ( $this->storageClient->blobExists( $dstCont, $dstRel ) ) { |
| 174 | + $status->fatal( 'backend-fail-alreadyexists', $params['dst'] ); |
| 175 | + return $status; |
| 176 | + } |
174 | 177 | } |
175 | 178 | |
176 | 179 | // Actually create the object |
— | — | @@ -241,19 +244,6 @@ |
242 | 245 | } |
243 | 246 | |
244 | 247 | /** |
245 | | - * @see FileBackend::fileExists() |
246 | | - */ |
247 | | - function doFileExists( array $params ) { |
248 | | - list( $srcCont, $srcRel ) = $this->resolveStoragePath( $params['src'] ); |
249 | | - if ( $srcRel === null ) { |
250 | | - return false; // invalid storage path |
251 | | - } |
252 | | - |
253 | | - $exists = $this->storageClient->blobExists( $srcCont, $srcRel ); |
254 | | - return $exists; |
255 | | - } |
256 | | - |
257 | | - /** |
258 | 248 | * @see FileBackend::getFileList() |
259 | 249 | */ |
260 | 250 | function getFileListInternal( $container, $dir, array $params ) { |