Search in sources :

Example 1 with PathMappedListResult

use of org.commonjava.indy.pathmapped.model.PathMappedListResult in project indy by Commonjava.

the class PathMappedController method list.

public PathMappedListResult list(String packageType, String type, String name, String path, boolean recursive, String fileType, int limit) {
    PathDB.FileType fType = PathDB.FileType.all;
    if (isNotBlank(fileType)) {
        fType = PathDB.FileType.valueOf(fileType);
    }
    String[] list;
    StoreKey storeKey = new StoreKey(packageType, StoreType.get(type), name);
    if (recursive) {
        int lmt = DEFAULT_RECURSIVE_LIST_LIMIT;
        if (limit > 0) {
            lmt = limit;
        }
        list = fileManager.list(storeKey.toString(), path, true, lmt, fType);
    } else {
        list = fileManager.list(storeKey.toString(), path, fType);
    }
    return new PathMappedListResult(packageType, type, name, path, list);
}
Also used : PathDB(org.commonjava.storage.pathmapped.spi.PathDB) PathMappedListResult(org.commonjava.indy.pathmapped.model.PathMappedListResult) StoreKey(org.commonjava.indy.model.core.StoreKey)

Aggregations

StoreKey (org.commonjava.indy.model.core.StoreKey)1 PathMappedListResult (org.commonjava.indy.pathmapped.model.PathMappedListResult)1 PathDB (org.commonjava.storage.pathmapped.spi.PathDB)1