use of java.util.Collections in project Gargoyle by callakrsos.
the class DimList method list.
/********************************
* 작성일 : 2017. 4. 24. 작성자 : KYJ
*
* path에 속하는 하위 구성정보 조회
*
* @param path
* @param revision
* @param exceptionHandler
* @return
********************************/
public <T> List<T> list(String projSpec, String path, String fileName, String revision, Function<ItemRevision, T> convert, Consumer<Exception> exceptionHandler) {
List<T> collections = Collections.emptyList();
DimensionsConnection conn = null;
try {
conn = getConnection();
Project projObj = getProject(conn, projSpec);
RepositoryFolder findRepositoryFolderByPath = projObj.findRepositoryFolderByPath(path);
Filter filter = new Filter();
if (ValueUtil.isNotEmpty(fileName))
filter.criteria().add(new Filter.Criterion(SystemAttributes.ITEMFILE_FILENAME, fileName, Filter.Criterion.EQUALS));
if (ValueUtil.equals("-1", revision)) {
filter.criteria().add(new Filter.Criterion(SystemAttributes.IS_LATEST_REV, "Y", 0));
} else {
filter.criteria().add(new Filter.Criterion(SystemAttributes.REVISION, revision, Filter.Criterion.EQUALS));
}
List allChildFolders = findRepositoryFolderByPath.getAllChildFolders();
List<DimensionsRelatedObject> childItems = findRepositoryFolderByPath.getChildItems(filter);
// Stream.concat(allChildFolders, childItems);
List<ItemRevision> collect = childItems.stream().map(i -> (ItemRevision) i.getObject()).collect(Collectors.toList());
collections = collect.stream().map(convert).collect(Collectors.toList());
} catch (Exception e) {
exceptionHandler.accept(e);
} finally {
manager.close(conn);
}
return collections;
}
use of java.util.Collections in project coffeenet-starter by coffeenet.
the class CoffeeNetWebServiceImpl method get.
@Override
public CoffeeNetWeb get() {
CoffeeNetWebUser coffeeNetWebUser = coffeeNetWebExtractor.extractUser().orElse(null);
Map<String, List<CoffeeNetApp>> apps = coffeeNetWebExtractor.extractApps().orElseGet(Collections::emptyMap);
String logoutPath = coffeeNetWebExtractor.extractLogoutPath();
List<CoffeeNetApp> profileApps = apps.get("profile");
CoffeeNetApp profileApp = null;
if (profileApps != null && !profileApps.isEmpty()) {
profileApp = profileApps.get(0);
}
List<CoffeeNetApp> coffeeNetApps = apps.get("apps");
return new CoffeeNetWeb(coffeeNetWebUser, coffeeNetApps, profileApp, logoutPath);
}
Aggregations