Pass through to provider ResourceLookupSession.use_federated_bin_view
972483
def use_federated_bin_view(self):
        """"""
        self._bin_view = FEDERATED
        # self._get_provider_session('resource_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_federated_bin_view()
            except AttributeError:
                pass
466186
private void addBinaryResourcePath(BinaryResourcesHandler binRsHandler, String resourcePath) {

		try {
			String resultPath = CheckSumUtils.getCacheBustedUrl(resourcePath, rsReaderHandler, jawrConfig);
			binRsHandler.addMapping(resourcePath, resultPath);
			bundleMapping.put(resourcePath, resultPath);
		} catch (IOException e) {
			LOGGER.error("An exception occurs while defining the mapping for the file : " + resourcePath, e);
		} catch (ResourceNotFoundException e) {
			LOGGER.error("Impossible to define the checksum for the resource '" + resourcePath
					+ "'. Unable to retrieve the content of the file.");
		}
	}
310188
def get_bins_by_resource(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceBinSession.get_bins_by_resource
        catalogs = self._get_provider_session('resource_bin_session').get_bins_by_resource(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Bin(self._provider_manager, cat, self._runtime, self._proxy))
        return BinList(cat_list)
747840
def generate_view(ase):
        # type: (blobxfer.models.azure.StorageEntity) ->
        #       Tuple[LocalPathView, int]
        
        slicesize = blobxfer.models.download.Descriptor.compute_allocated_size(
            ase.size, ase.is_encrypted)
        if ase.vectored_io is None:
            view = LocalPathView(
                fd_start=0,
                fd_end=slicesize,
            )
            total_size = slicesize
        else:
            view = LocalPathView(
                fd_start=ase.vectored_io.offset_start,
                fd_end=ase.vectored_io.offset_start + slicesize,
            )
            total_size = ase.vectored_io.total_size
        return view, total_size
903580
def use_plenary_asset_view(self):
        """"""
        self._object_views['asset'] = PLENARY
        # self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_asset_view()
            except AttributeError:
                pass
70832
def _set_repository_view(self, session):
        """"""
        if self._repository_view == FEDERATED:
            try:
                session.use_federated_repository_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_isolated_repository_view()
            except AttributeError:
                pass
455160
void processServerContentRequest() {

        File installRoot = new File(locationService.resolveString("${wlp.install.dir}"));

        final Set<String> absPathsForLibertyContent = new HashSet<String>();
        final Map<String, List<String>> specificPlatformPathsByPlatform = new HashMap<String, List<String>>();
        Set<String> discoveredFeatures = new HashSet<String>();
        Collection<FeatureResource> fixes = new ArrayList<FeatureResource>();

        // We need ALL Kernel features (even the ones that aren't active in the system)
        // as well as all installed features.
        List<ProvisioningFeatureDefinition> allFeatureDefs = new ArrayList<ProvisioningFeatureDefinition>();
        allFeatureDefs.addAll(KernelFeatureDefinitionImpl.getAllKernelFeatures(bundleContext, locationService));
        allFeatureDefs.addAll(featureResolver.getInstalledFeatureDefinitions());

        //keep a list of product extensions being used in the server
        List<String> extensionRepos = new ArrayList<String>();

        for (ProvisioningFeatureDefinition fd : allFeatureDefs) {

            BundleRepositoryHolder brh = BundleRepositoryRegistry.getRepositoryHolder(fd.getBundleRepositoryType());
            ContentBasedLocalBundleRepository br = brh.getBundleRepository();
            Collection<FeatureResource> frs = fd.getConstituents(null);

            /*
             * lib/fixes processing needs to happen here, to filter the xml down to just the current in use set.
             * made slightly more complex, because the locations tracked for minify are absolute, so we have to identify and trim installroot
             * to identify lib/fixes/* content, which we process afterward
             */
            File libFixes = new File(installRoot, "lib/fixes");

            for (FeatureResource fr : frs) {
                switch (fr.getType()) {
                    case FEATURE_TYPE: {
                        //type = feature, no paths to worry about, we are processing the list of all installed features
                        //                which will include nested features.
                        discoveredFeatures.add(fr.getSymbolicName());
                        break;
                    }

                    case BUNDLE_TYPE:
                    case JAR_TYPE:
                    case BOOT_JAR_TYPE: {
                        //type = bundle, need to query the bundle repository for this feature def, to find which
                        //               files are being used.
                        //type = jar, basically same as type=bundle.. for minify purposes.
                        //type = boot.jar, basically same as type=bundle.. for minify purposes.
                        File b = br.selectBundle(fr.getLocation(), fr.getSymbolicName(), fr.getVersionRange());
                        File bb = br.selectBaseBundle(fr.getLocation(), fr.getSymbolicName(), fr.getVersionRange());
                        //b & bb will be the same bundle if the base was the selected.. 
                        if (b != null && bb != null) {
                            boolean pathsSame = b.getAbsolutePath().equals(bb.getAbsolutePath());
                            absPathsForLibertyContent.add(b.getAbsolutePath());
                            if (!pathsSame) {
                                absPathsForLibertyContent.add(bb.getAbsolutePath());
                            }
                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                for (String os : osList) {
                                    List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                    if (pathsForOs == null) {
                                        pathsForOs = new ArrayList<String>();
                                        specificPlatformPathsByPlatform.put(os, pathsForOs);
                                    }
                                    pathsForOs.add(b.getAbsolutePath());
                                    if (!pathsSame) {
                                        pathsForOs.add(bb.getAbsolutePath());
                                    }
                                }
                            }
                        } else {
                            //b & bb were null, we have no match for this resource.. 
                            //maybe the resource was minfiied out?
                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                //ignore the missing resource, as the file is tagged for specific os's,
                                //and will be reported missing based on the os filters later.
                                //(if the user has no os filter set, they meant 'all currently supported by the install')
                                //(so this can still be ignored).
                            } else {
                                //use match string for error message, it provides best chance for being helpful.
                                Tr.warning(tc, "ERROR_MISSING_FEATURE_RESOURCE", new Object[] { fd.getFeatureName(), fr.getMatchString() });
                            }
                        }
                        break;
                    }

                    case FILE_TYPE: {
                        //file uses loc as a relative path from install root.
                        String locString = fr.getLocation();
                        if (locString != null) {
                            String[] locs;
                            if (locString.contains(",")) {
                                locs = locString.split(",");
                            } else {
                                locs = new String[] { locString };
                            }

                            for (String loc : locs) {
                                File test = new File(loc);
                                if (!test.isAbsolute()) {
                                    test = new File(brh.getInstallDir(), loc);
                                }
                                loc = test.getAbsolutePath();
                                //filter fixes content into the fixes set, all other content is remembered.
                                if (loc.startsWith(libFixes.getAbsolutePath() + File.separator)) {
                                    fixes.add(fr);
                                } else {
                                    absPathsForLibertyContent.add(loc);
                                }

                                List<String> osList = fr.getOsList();
                                if (osList != null) {
                                    for (String os : osList) {
                                        List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                        if (pathsForOs == null) {
                                            pathsForOs = new ArrayList<String>();
                                            specificPlatformPathsByPlatform.put(os, pathsForOs);
                                        }
                                        pathsForOs.add(loc);
                                    }
                                }
                            }
                        } else {
                            //a file type without a loc is bad, means misuse of the type.
                            Tr.warning(tc, "ERROR_UNKNOWN_FEATURE_RESOURCE_TYPE", new Object[] { fd.getFeatureName(), fr.getSymbolicName(), "file" });
                        }
                        break;
                    }

                    case UNKNOWN: {
                        //if its not jar,bundle,feature, or file.. then something is wrong.
                        Tr.warning(tc, "ERROR_UNKNOWN_FEATURE_RESOURCE_TYPE", new Object[] { fd.getFeatureName(),
                                                                                            fr.getSymbolicName(),
                                                                                            fr.getRawType() });
                        //we assume that other types will use the location field as something useful.
                        String loc = fr.getLocation();
                        if (loc != null) {
                            File test = new File(loc);
                            if (!test.isAbsolute()) {
                                test = new File(installRoot, loc);
                            }
                            absPathsForLibertyContent.add(test.getAbsolutePath());

                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                for (String os : osList) {
                                    List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                    if (pathsForOs == null) {
                                        pathsForOs = new ArrayList<String>();
                                        specificPlatformPathsByPlatform.put(os, pathsForOs);
                                    }
                                    pathsForOs.add(test.getAbsolutePath());
                                }
                            }
                        }
                        break;
                    }
                    default:
                        break;
                }
            }
            //add in (all) the NLS files for this featuredef.. if any..
            for (File nls : fd.getLocalizationFiles()) {
                if (nls.exists()) {
                    absPathsForLibertyContent.add(nls.getAbsolutePath());
                }
            }

            //add in the manifest for the feature itself .. 
            File featureFile = fd.getFeatureDefinitionFile();
            if (featureFile != null) {
                absPathsForLibertyContent.add(featureFile.getAbsolutePath());
            }
            File checksumFile = fd.getFeatureChecksumFile();
            if (checksumFile != null) {
                absPathsForLibertyContent.add(checksumFile.getAbsolutePath());
            }

            String repoType = fd.getBundleRepositoryType();
            //work out if this content is a product extension and if it is include its properties file
            if (repoType != null && !ExtensionConstants.CORE_EXTENSION.equals(repoType)
                && !ExtensionConstants.USER_EXTENSION.equals(repoType)) {
                //not core or user, must be a product extension
                extensionRepos.add(repoType);
            }

            // Add in any Icon files
            File featureDefinitionFile = fd.getFeatureDefinitionFile();
            if (featureDefinitionFile != null) {
                File featureDefinitionParent = featureDefinitionFile.getParentFile();
                Collection<String> expectedIcons = fd.getIcons();
                if (featureDefinitionParent != null && expectedIcons != null) {
                    File iconsFolder = new File(featureDefinitionParent, "icons/" + fd.getSymbolicName());
                    scanFolderForIcons(absPathsForLibertyContent, iconsFolder.getAbsolutePath(), iconsFolder, expectedIcons);
                }
            }

        }

        //if there are any extensions in use we need to bring their wlp/etc/extensions/*.properties file along
        for (String extensionRepo : extensionRepos) {
            WsResource extensionProperties = locationService.getRuntimeResource("etc/extensions/" + extensionRepo + ".properties");
            absPathsForLibertyContent.add(locationService.resolveResource(extensionProperties.toRepositoryPath()).asFile().getAbsolutePath());
        }

        //this odd looking bit of code will take the current list of files identified,
        //and if any are jars, will look in them to see if they have manifest classpaths
        //if so, the jars referenced by the manifest classpaths are added to the manifestJars
        //argument.
        //We have to start by passing both args as the current set of content (but using different set instances).
        Set<String> manifestJars = new HashSet<String>();
        manifestJars.addAll(absPathsForLibertyContent);
        gatherManifestClasspathJars(absPathsForLibertyContent, manifestJars);
        manifestJars.removeAll(absPathsForLibertyContent);

        //now manifestJars contains any jars that we didn't already know about, discovered via manifests.
        absPathsForLibertyContent.addAll(manifestJars);

        //process the fixes set of fix xml's, and add the required ones to the set of files to keep.
        addRequiredFixFiles(installRoot, absPathsForLibertyContent, fixes);

        final String OS_REMOVE_CHAR = "-";

        //publish the service that will be used by the launcher to read back the data.
        final Dictionary<String, Object> d = new Hashtable<String, Object>();
        final String[] pathArray = absPathsForLibertyContent.toArray(new String[] {});

        bundleContext.registerService(ServerContent.class, new ServerContent() {
            @Override
            public String[] getServerContentPaths(String osRequest) throws IOException {
                if (osRequest == null || osRequest.isEmpty() || "all".equals(osRequest))
                    return pathArray;
                else {
                    //filter paths as required.. then return them..                                       
                    String[] osNames = osRequest.split(",");
                    boolean add = true;

                    //check if this is an add, or a remove.
                    //if both are specified, remove wins ;p
                    for (String osName : osNames) {
                        if (osName.startsWith(OS_REMOVE_CHAR)) {
                            add = false;
                        }
                    }

                    if (add) {
                        //someone has named an os (or os's) they want
                        //so we remove everything, and add back just those os's.
                        for (Map.Entry<String, List<String>> me : specificPlatformPathsByPlatform.entrySet()) {
                            absPathsForLibertyContent.removeAll(me.getValue());
                        }
                        for (String osName : osNames) {
                            if (!osName.startsWith(OS_REMOVE_CHAR)) {
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    absPathsForLibertyContent.addAll(osPaths);

                                    //verify the requested paths File.exists .. otherwise 
                                    //this could be an error ?
                                    for (String osPath : osPaths) {
                                        if (!FileUtils.fileExists(new File(osPath))) {
                                            throw new FileNotFoundException(osPath);
                                        }
                                    }
                                }
                            }
                        }
                    } else {
                        //user request 'all except this platform' type filter..
                        for (String osName : osNames) {
                            if (osName.startsWith(OS_REMOVE_CHAR)) {
                                osName = osName.substring(1);
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    absPathsForLibertyContent.removeAll(osPaths);
                                    //in this kind of filter, we don't need to test at all.
                                }
                            } else {
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    //verify the requested paths File.exists .. otherwise 
                                    //this could be an error.
                                    for (String osPath : osPaths) {
                                        if (!FileUtils.fileExists(new File(osPath))) {
                                            throw new FileNotFoundException(osPath);
                                        }
                                    }
                                }
                            }
                        }
                    }

                    //return newly filtered data
                    return absPathsForLibertyContent.toArray(new String[] {});
                }
            }
        }, d);

        //we're done here.. let liberty proceed to declare itself 'started' =)
    }
4075
def use_plenary_bin_view(self):
        """"""
        self._bin_view = PLENARY
        # self._get_provider_session('resource_bin_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_bin_view()
            except AttributeError:
                pass
1130148
function(bin, full) {
      var url = [];

      if (bin.url) {
        url.push(bin.url);

        if (bin.revision) {
          url.push(bin.revision);
        }
      }

      return this.url(url.join('/'), full);
    }
989993
def use_plenary_repository_view(self):
        """"""
        self._repository_view = PLENARY
        # self._get_provider_session('asset_repository_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_repository_view()
            except AttributeError:
                pass
465142
def access_storage_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:storage:view', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
1066428
private Resource findComponentResourceBundleLocaleMatch(FacesContext context, 
            String resourceName, String libraryName) {
        Resource result = null;
        ResourceBundle resourceBundle = null;
        int i;
        if (-1 != (i = resourceName.lastIndexOf("."))) {
            resourceName = resourceName.substring(0, i) +
                    ".properties";
            if (null != context) {
                result = context.getApplication().getResourceHandler().
                        createResource(resourceName, libraryName);
                InputStream propertiesInputStream = null;
                try {
                    propertiesInputStream = result.getInputStream();
                    resourceBundle = new PropertyResourceBundle(propertiesInputStream);
                } catch (IOException ex) {
                    Logger.getLogger(UIComponent.class.getName()).log(Level.SEVERE, null, ex);
                } finally{
                    if(null != propertiesInputStream){
                        try{
                            propertiesInputStream.close();
                        } catch(IOException ioe){
                            if (LOGGER.isLoggable(Level.SEVERE)) {
                                LOGGER.log(Level.SEVERE, null, ioe);
                            }
                        }
                    }
                }
            }
        }
        result = (null != resourceBundle) ? result : null;
        
        return result;
    }
982307
private void addToCache(BundleInfo bInfo) {
        List<Resource> info = _cacheBySymbolicName.get(bInfo.symbolicName);
        if (info == null) {
            info = new ArrayList<Resource>();
            info.add(bInfo);
        }

        info = _cacheBySymbolicName.putIfAbsent(bInfo.symbolicName, info);

        if (info != null) {
            synchronized (info) {
                info.add(bInfo);
            }
        }

        _bundleLocations.add(bInfo.file);
    }
646311
private static void dfVisit(DMNResource node, List<DMNResource> allNodes, Collection<DMNResource> visited, List<DMNResource> dfv) {
        if (visited.contains(node)) {
            throw new RuntimeException("Circular dependency detected: " + visited + " , and again to: " + node);
        }
        visited.add(node);

        List<DMNResource> neighbours = node.getDependencies().stream()
                                           .flatMap(dep -> allNodes.stream().filter(r -> r.getModelID().equals(dep)))
                                           .collect(Collectors.toList());
        for (DMNResource n : neighbours) {
            if (!visited.contains(n)) {
                dfVisit(n, allNodes, visited, dfv);
            }
        }

        dfv.add(node);
    }
1363127
function(view, config, widget) {

		var name,
			resource_owner,
			container_resources,
			static_classes,
			static_properties,
			static_styles;

		this._id = Lava.ELEMENT_ID_PREFIX + view.guid;

		this._view = view;
		this._config = config;
		this._widget = widget;
		this._tag_name = config.tag_name;
		this._is_void = Lava.isVoidTag(this._tag_name);

		if (Lava.schema.RESOURCES_ENABLED && config.resource_id) {

			resource_owner = Lava.view_manager.locateTarget(widget, config.resource_id.locator_type, config.resource_id.locator);
			if (Lava.schema.DEBUG && !resource_owner) Lava.t("[Element container] resource owner not found: " + config.resource_id.locator_type + "=" + config.resource_id.locator);
			container_resources = resource_owner.getResource(config.resource_id.name);

		}

		if (Lava.schema.RESOURCES_ENABLED && container_resources) {

			if (Lava.schema.DEBUG && container_resources.type != 'container') Lava.t("Element container: received resource type is not container: " + container_resources.type);
			static_classes = container_resources.value['static_classes'];
			static_properties = container_resources.value['static_properties'];
			static_styles = container_resources.value['static_styles'];

		} else {

			static_classes = config['static_classes'];
			static_properties = config['static_properties'];
			static_styles = config['static_styles'];

		}

		if (Lava.schema.DEBUG && static_properties && ('id' in static_properties))
			Lava.t("Element container: id must not be set via resources or be in config.static_properties");

		// Must clone everything, cause additional statics can be added to the element at run time
		if (static_classes) this._static_classes = static_classes.slice();
		for (name in static_styles) {
			this._static_styles[name] = static_styles[name];
		}
		for (name in static_properties) {
			this._static_properties[name] = static_properties[name];
		}

		for (name in config.events) {
			this._events[name] = Firestorm.clone(config.events[name]); // Object.<string, Array.<_cTarget>>
		}

		this._property_bindings = this._createArguments(config.property_bindings, view, this._onPropertyBindingChanged);
		this._style_bindings = this._createArguments(config.style_bindings, view, this._onStyleBindingChanged);
		// note: class_bindings is also an object. TemplateParser names properties numerically, starting from zero.
		this._class_bindings = this._createArguments(config.class_bindings, view, this._onClassBindingChanged);

		for (name in this._class_bindings) {

			this._class_bindings_values[name] = this._toClassNames(this._class_bindings[name].getValue() || '');

		}

	}
10793
def use_comparative_bin_view(self):
        """"""
        self._bin_view = COMPARATIVE
        # self._get_provider_session('resource_bin_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_comparative_bin_view()
            except AttributeError:
                pass
199097
@Nullable static View getView(Context context, int resourceId, View view) {
    LayoutInflater inflater = LayoutInflater.from(context);
    if (view != null) {
      return view;
    }
    if (resourceId != INVALID) {
      view = inflater.inflate(resourceId, null);
    }
    return view;
  }