SwiftStorageProvider extends S3StorageProvider { @Override protected String getSpaceId(String bucketName) { String spaceId = bucketName; String truncatedKey = truncateKey(accessKeyId); if (isSpace(bucketName)) { spaceId = spaceId.substring(truncatedKey.length() + 1); } return spaceId; } SwiftStorageProvider(String accessKey, String secretKey, Map<String, String> options);  SwiftStorageProvider(AmazonS3 s3Client, String accessKey); @Override StorageProviderType getStorageProviderType(); @Override void removeSpace(String spaceId); @Override String createHiddenSpace(String spaceId, int expirationInDays); ObjectMetadata expireObject(String bucketName, String contentId, Integer seconds);  }
@Test public void testGetSpaceId() { SwiftStorageProvider provider = new SwiftStorageProvider(accessKey, secretKey, null); String testSpaceId = provider.getSpaceId(truncateKey() + ".test-space"); assertEquals(testSpaceId, "test-space"); }