class DropboxPathContainerService extends PathContainerService {

    @Override
    public String getKey(final Path file) {
        if(PreferencesFactory.get().getBoolean("dropbox.business.enable")) {
            final Path container = this.getContainer(file);
            final String namespace = container.attributes().getVersionId();
            if(StringUtils.isNotBlank(namespace)) {
                if(file.isRoot()) {
                    // Root
                    if(useNamespace) {
                        return String.format("ns:%s", namespace);
                    }
                    return StringUtils.EMPTY;
                }
                // Return path relative to the namespace root
                final String key = this.isContainer(file) ? StringUtils.EMPTY : Path.DELIMITER + super.getKey(file);
                if(useNamespace) {
                    return String.format("ns:%s%s", namespace, key);
                }
                return key;
            }
        }
        return file.isRoot() ? StringUtils.EMPTY : file.getAbsolute();
    }

}