class PreferenceStorageImpl implements PreferenceStorage {

    @Override
    public Collection<String> allKeys(final PreferenceScope scope) {
        Collection<String> keys = new ArrayList<>();
        Path path = this.objectStorage.getPath(buildScopePath(scope));

        if (ioService.exists(path)) {
            walkFileTree(checkNotNull("path",
                                      path),
                         new SimpleFileVisitor<Path>() {
                             @Override
                             public FileVisitResult visitFile(final Path file,
                                                              final BasicFileAttributes attrs) throws IOException {
                                 try {
                                     checkNotNull("file",
                                                  file);

                                     final String fileName = file.getFileName().toString();
                                     final int keyEndIndex = fileName.length() - FILE_FORMAT_SIZE;
                                     final String fileNameWithoutFormat = fileName.substring(0,
                                                                                             keyEndIndex);

                                     keys.add(fileNameWithoutFormat);
                                 } catch (final Exception ex) {
                                     logger.error("An unexpected exception was thrown: ",
                                                  ex);
                                     return FileVisitResult.TERMINATE;
                                 }

                                 return FileVisitResult.CONTINUE;
                             }
                         });
        }

        return keys;
    }

    protected  PreferenceStorageImpl();
    @Inject public  PreferenceStorageImpl(@Named("ioStrategy") final IOService ioService,
                                 final SessionInfo sessionInfo,
                                 @Customizable final PreferenceScopeTypes scopeTypes,
                                 final PreferenceScopeFactory scopeFactory,
                                 final ObjectStorage objectStorage,
                                 final SpacesAPI spaces,
                                 final Event<PreferenceUpdatedEvent> preferenceUpdatedEvent);

}