All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.lightspeed7.mongofs.MongoFileConstants Maven / Gradle / Ivy

Go to download

An extension to the MongoDB Java Driver library that goes beyond what the GridFS feature supports. Compressed file storage, zip files, temporary files

There is a newer version: 0.10.0
Show newest version
package me.lightspeed7.mongofs;

import java.util.Set;
import java.util.TreeSet;

/**
 * 
 * @author David Buschman
 * 
 */
public enum MongoFileConstants {

    _id(true), //
    filename(true), //
    contentType(true), //
    chunkSize(true), //
    length(true), //
    uploadDate(true), //
    aliases(true), //
    md5(true), //
    metadata(true), //
    chunkCount(false), //
    compressedLength(false), // deprecated, now uses storage
    storage(false), //
    compressionRatio(false), // deprecated, now uses ratio
    ratio(false), //
    compressionFormat(false), // deprecated, now uses format
    format(false), //
    expireAt(false), //
    deleted(false), //
    manifestId(false), // expanded zip file support
    manifestNum(false); // expanded zip file support
    //

    private boolean core = false;

    private MongoFileConstants(final boolean core) {

        this.core = core;
    }

    public static Set getFields(final boolean mongoFS) {

        Set set = new TreeSet();

        for (MongoFileConstants current : MongoFileConstants.values()) {
            if (current.core || mongoFS) {
                set.add(current.name());
            }
        }

        return set;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy