use of org.jboss.vfs.util.AbstractVirtualFileFilterWithAttributes in project keycloak by keycloak.
the class KeycloakProviderDependencyProcessor method getKeycloakProviderDeploymentInfo.
public static KeycloakDeploymentInfo getKeycloakProviderDeploymentInfo(DeploymentUnit du) {
KeycloakDeploymentInfo info = KeycloakDeploymentInfo.create();
info.name(du.getName());
final ResourceRoot resourceRoot = du.getAttachment(Attachments.DEPLOYMENT_ROOT);
if (resourceRoot != null) {
final VirtualFile deploymentRoot = resourceRoot.getRoot();
if (deploymentRoot != null && deploymentRoot.exists()) {
if (deploymentRoot.getChild("META-INF/keycloak-themes.json").exists() && deploymentRoot.getChild("theme").exists()) {
info.themes();
}
if (deploymentRoot.getChild("theme-resources").exists()) {
info.themeResources();
}
VirtualFile services = deploymentRoot.getChild("META-INF/services");
if (services.exists()) {
try {
List<VirtualFile> archives = services.getChildren(new AbstractVirtualFileFilterWithAttributes() {
@Override
public boolean accepts(VirtualFile file) {
return file.getName().startsWith("org.keycloak");
}
});
if (!archives.isEmpty()) {
info.services();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return info;
}
Aggregations