class SwiftWriteFeature extends AbstractHttpWriteFeature<StorageObject> implements Write<StorageObject> {

    @Override
    public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException {
        if(length >= preferences.getLong("openstack.upload.largeobject.threshold")) {
            if(preferences.getBoolean("openstack.upload.largeobject")) {
                final List<Path> segments;
                long size = 0L;
                try {
                    segments = listService.list(segmentService.getSegmentsDirectory(file, length), new DisabledListProgressListener()).toList();
                    if(segments.isEmpty()) {
                        return Write.notfound;
                    }
                }
                catch(NotfoundException e) {
                    return Write.notfound;
                }
                for(Path segment : segments) {
                    size += segment.attributes().getSize();
                }
                return new Append(size);
            }
        }
        if(finder.withCache(cache).find(file)) {
            final PathAttributes attr = attributes.withCache(cache).find(file);
            return new Append(false, true).withSize(attr.getSize()).withChecksum(attr.getChecksum());
        }
        return Write.notfound;
    }

    public  SwiftWriteFeature(final SwiftSession session, final SwiftRegionService regionService);
    public  SwiftWriteFeature(final SwiftSession session, final SwiftRegionService regionService,
                             final SwiftObjectListService listService,
                             final SwiftSegmentService segmentService);
    public  SwiftWriteFeature(final SwiftSession session, final SwiftRegionService regionService,
                             final SwiftObjectListService listService,
                             final SwiftSegmentService segmentService, final Find finder);
    public  SwiftWriteFeature(final SwiftSession session, final SwiftRegionService regionService,
                             final SwiftObjectListService listService,
                             final SwiftSegmentService segmentService,
                             final Find finder, final AttributesFinder attributes);

}