|
16 | 16 |
|
17 | 17 | import com.emc.atmos.AtmosException;
|
18 | 18 | import com.emc.atmos.api.*;
|
19 |
| -import com.emc.atmos.api.bean.*; |
| 19 | +import com.emc.atmos.api.bean.DirectoryEntry; |
| 20 | +import com.emc.atmos.api.bean.Metadata; |
| 21 | +import com.emc.atmos.api.bean.ServiceInformation; |
20 | 22 | import com.emc.atmos.api.jersey.AtmosApiClient;
|
21 | 23 | import com.emc.atmos.api.request.ListDirectoryRequest;
|
22 | 24 | import com.emc.vipr.sync.filter.SyncFilter;
|
@@ -211,17 +213,19 @@ public void configure(SyncSource source, Iterator<SyncFilter> filters, SyncTarge
|
211 | 213 |
|
212 | 214 | if (namespace) {
|
213 | 215 | if (!namespaceRoot.startsWith("/")) namespaceRoot = "/" + namespaceRoot;
|
214 |
| - namespaceRoot = namespaceRoot.replaceFirst("/$", ""); |
215 |
| - |
216 |
| - // does namespaceRoot exist? |
217 |
| - try { |
218 |
| - Metadata typeMeta = atmos.getSystemMetadata(new ObjectPath(namespaceRoot)).get(AtmosUtil.TYPE_KEY); |
219 |
| - if (AtmosUtil.DIRECTORY_TYPE.equals(typeMeta.getValue())) |
220 |
| - namespaceRoot += "/"; |
221 |
| - } catch (AtmosException e) { |
222 |
| - if (e.getErrorCode() == 1003) |
223 |
| - throw new ConfigurationException("specified path does not exist in the cloud"); |
224 |
| - throw e; |
| 216 | + if (!namespaceRoot.equals("/")) { |
| 217 | + namespaceRoot = namespaceRoot.replaceFirst("/$", ""); |
| 218 | + |
| 219 | + // does namespaceRoot exist? |
| 220 | + try { |
| 221 | + Metadata typeMeta = atmos.getSystemMetadata(new ObjectPath(namespaceRoot)).get(AtmosUtil.TYPE_KEY); |
| 222 | + if (AtmosUtil.DIRECTORY_TYPE.equals(typeMeta.getValue())) |
| 223 | + namespaceRoot += "/"; |
| 224 | + } catch (AtmosException e) { |
| 225 | + if (e.getErrorCode() == 1003) |
| 226 | + throw new ConfigurationException("specified path does not exist in the cloud"); |
| 227 | + throw e; |
| 228 | + } |
225 | 229 | }
|
226 | 230 | }
|
227 | 231 | }
|
|
0 commit comments