if (config.getPath() == null) config.setPath("/"); if (!config.getPath().startsWith("/")) config.setPath("/" + config.getPath()); if (!config.getPath().equals("/")) { config.setPath(config.getPath().replaceFirst("/$", "")); // remove trailing slash Map<String, Metadata> sysMeta = atmos.getSystemMetadata(new ObjectPath(config.getPath())); Metadata typeMeta = sysMeta.get(TYPE_PROP); if (typeMeta != null && DIRECTORY_TYPE.equals(typeMeta.getValue())) { if (!config.getPath().endsWith("/")) config.setPath(config.getPath() + "/"); rootSummary = new ObjectSummary(config.getPath(), true, 0); } else { Metadata sizeMeta = sysMeta.get(SIZE_PROP); long size = sizeMeta == null ? 0L : Long.parseLong(sizeMeta.getValue()); rootSummary = new ObjectSummary(config.getPath(), false, size); } else { if (!config.getPath().endsWith("/")) config.setPath(config.getPath() + "/"); rootSummary = new ObjectSummary(config.getPath(), true, 0); } else throw new ConfigurationException("could not locate path " + config.getPath(), e);
Assert.assertEquals("source uid mismatch", sourceUid, atmosSource.getUid()); Assert.assertEquals("source secret mismatch", sourceSecret, atmosSource.getSecret()); Assert.assertEquals("source path mismatch", sourcePath, atmosSource.getPath()); Assert.assertEquals("source accessType mismatch", sourceAccessType, atmosSource.getAccessType()); Assert.assertTrue("source removeTagsOnDelete should be enabled", atmosSource.isRemoveTagsOnDelete()); Assert.assertEquals("target uid mismatch", targetUid, atmosTarget.getUid()); Assert.assertEquals("target secret mismatch", targetSecret, atmosTarget.getSecret()); Assert.assertEquals("target path mismatch", targetPath, atmosTarget.getPath()); Assert.assertEquals("target accessType mismatch", targetAccessType, atmosTarget.getAccessType()); Assert.assertEquals("target wsChecksumType mismatch", targetChecksum, atmosTarget.getWsChecksumType());