@Test(expected = NotfoundException.class) public void testNotFound() throws Exception { final Path container = new Path("versioning-test-us-east-1-cyberduck", EnumSet.of(Path.Type.volume)); final Path test = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final S3StorageClassFeature feature = new S3StorageClassFeature(session); feature.getClass(test); }
@Override public String getClass(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.storageclass.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return preferences.getProperty(key); } return S3Object.STORAGE_CLASS_STANDARD; } final String redundancy = new S3AttributesFinderFeature(session).find(file).getStorageClass(); if(StringUtils.isBlank(redundancy)) { return S3Object.STORAGE_CLASS_STANDARD; } return redundancy; }
S3StorageClassFeature implements Redundancy { @Override public String getClass(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.storageclass.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return preferences.getProperty(key); } return S3Object.STORAGE_CLASS_STANDARD; } final String redundancy = new S3AttributesFinderFeature(session).find(file).getStorageClass(); if(StringUtils.isBlank(redundancy)) { return S3Object.STORAGE_CLASS_STANDARD; } return redundancy; } }
S3StorageClassFeature implements Redundancy { @Override public String getClass(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.storageclass.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return preferences.getProperty(key); } return S3Object.STORAGE_CLASS_STANDARD; } final String redundancy = new S3AttributesFinderFeature(session).find(file).getStorageClass(); if(StringUtils.isBlank(redundancy)) { return S3Object.STORAGE_CLASS_STANDARD; } return redundancy; } S3StorageClassFeature(final S3Session session); }
S3StorageClassFeature implements Redundancy { @Override public String getClass(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.storageclass.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return preferences.getProperty(key); } return S3Object.STORAGE_CLASS_STANDARD; } final String redundancy = new S3AttributesFinderFeature(session).find(file).getStorageClass(); if(StringUtils.isBlank(redundancy)) { return S3Object.STORAGE_CLASS_STANDARD; } return redundancy; } S3StorageClassFeature(final S3Session session); @Override String getDefault(); @Override Set<String> getClasses(); @Override String getClass(final Path file); @Override void setClass(final Path file, final String redundancy); }
S3StorageClassFeature implements Redundancy { @Override public String getClass(final Path file) throws BackgroundException { if(containerService.isContainer(file)) { final String key = String.format("s3.storageclass.%s", containerService.getContainer(file).getName()); if(StringUtils.isNotBlank(preferences.getProperty(key))) { return preferences.getProperty(key); } return S3Object.STORAGE_CLASS_STANDARD; } final String redundancy = new S3AttributesFinderFeature(session).find(file).getStorageClass(); if(StringUtils.isBlank(redundancy)) { return S3Object.STORAGE_CLASS_STANDARD; } return redundancy; } S3StorageClassFeature(final S3Session session); @Override String getDefault(); @Override Set<String> getClasses(); @Override String getClass(final Path file); @Override void setClass(final Path file, final String redundancy); static final Set<String> STORAGE_CLASS_LIST; }