Load the SARL files in the given resource set.

@param progress monitor of the progress of the compilation.
@param resourceSet the resource set to load from.
494936
protected void loadSARLFiles(ResourceSet resourceSet, IProgressMonitor progress) {
		assert progress != null;
		progress.subTask(Messages.SarlBatchCompiler_54);
		this.encodingProvider.setDefaultEncoding(getFileEncoding());
		final NameBasedFilter nameBasedFilter = new NameBasedFilter();
		nameBasedFilter.setExtension(this.fileExtensionProvider.getPrimaryFileExtension());
		final PathTraverser pathTraverser = new PathTraverser();
		final List<String> sourcePathDirectories = getSourcePathStrings();
		if (progress.isCanceled()) {
			return;
		}
		final Multimap<String, org.eclipse.emf.common.util.URI> pathes = pathTraverser.resolvePathes(sourcePathDirectories,
				input -> nameBasedFilter.matches(input));
		if (progress.isCanceled()) {
			return;
		}
		for (final String source : pathes.keySet()) {
			for (final org.eclipse.emf.common.util.URI uri : pathes.get(source)) {
				if (progress.isCanceled()) {
					return;
				}
				if (getLogger().isDebugEnabled()) {
					getLogger().debug(Messages.SarlBatchCompiler_7, uri);
				}
				resourceSet.getResource(uri, true);
			}
		}
	}
155527
public void setProgress(int progress) {
        if (progress > mMax || progress < 0) {
            throw new IllegalArgumentException(
                    String.format("Progress (%d) must be between %d and %d", progress, 0, mMax));
        }
        mProgress = progress;
        if (null != mListener) {
            if (mProgress == mMax) {
                mListener.onProgressCompleted();
            } else {
                mListener.onProgressChanged(mProgress, mMax);
            }
        }
        invalidate();
    }
133115
public void loadFile(File file, String resourcePath) throws IOException {
	loadFile(ResourceUtil.toResource(file), resourcePath);
    }
1161889
private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
        if (searchPattern.matcher(resourceName).matches()) {
            resources.add(resourceName);
        }
    }
1091762
@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String[] staticResourceMappingPath = {"classpath:/static/"};

        registry.addResourceHandler("/**").addResourceLocations(
                staticResourceMappingPath);
    }
969038
public void setProgress(float progress) {
        if (progress < 0)
            mProgress = 0;
        else if (mProgress > 1)
            mProgress = 1;
        else
            mProgress = progress;
        stop();
        onProgressChange(mProgress);
        invalidateSelf();
    }
219556
@SuppressWarnings("restriction")
    public static List<WorkItem> getResources(ChangeSet set) {
        if (set != null && !set.isEmpty()) {
            IResource[] resources = set.getResources();
            List<WorkItem> filtered = new ArrayList<>();
            for (IResource resource : resources) {
                if (resource.getType() == IResource.FILE && !Util.isJavaArtifact(resource)) {
                    // Ignore non java files
                    continue;
                }
                if (resource.exists()) {
                    // add only resources which are NOT deleted
                    filtered.add(new WorkItem(resource));
                }
            }
            return filtered;
        }
        return EMPTY;
    }
860813
private void processResourceRates()
   {
      List<Row> rows = getRows("rsrcrate", null, null);
      m_reader.processResourceRates(rows);
   }
388721
public void setS3Resources(java.util.Collection<S3Resource> s3Resources) {
        if (s3Resources == null) {
            this.s3Resources = null;
            return;
        }

        this.s3Resources = new java.util.ArrayList<S3Resource>(s3Resources);
    }
1024842
public static void loadPropertiesFile(final String filenameOrUrl)
    {
        final Properties properties = new Properties(System.getProperties());
        System.getProperties().forEach(properties::put);

        final URL resource = ClassLoader.getSystemClassLoader().getResource(filenameOrUrl);
        if (null != resource)
        {
            try (InputStream in = resource.openStream())
            {
                properties.load(in);
            }
            catch (final Exception ignore)
            {
            }
        }

        final File file = new File(filenameOrUrl);
        if (file.exists())
        {
            try (FileInputStream in = new FileInputStream(file))
            {
                properties.load(in);
            }
            catch (final Exception ignore)
            {
            }
        }

        try (InputStream in = new URL(filenameOrUrl).openStream())
        {
            properties.load(in);
        }
        catch (final Exception ignore)
        {
        }

        System.setProperties(properties);
    }
679447
protected void load(boolean needContent) throws IOException, CmsException {

        try {
            if (m_resource.isFolder() && needContent) {
                throw new AccessDeniedException("Operation not supported for directories!");
            }
            if (m_resource.isFile() && needContent && (!(m_resource instanceof CmsFile))) {
                m_resource = m_cms.readFile(m_cms.getSitePath(m_resource), CmsJlanDiskInterface.STANDARD_FILTER);
            }
            if (!m_bufferInitialized && (getFile() != null)) {
                // readResource may already have returned a CmsFile, this is why we need to initialize the buffer
                // here and not in the if-block above
                m_buffer.init(getFile().getContents());
                m_bufferInitialized = true;
            }
        } catch (CmsException e) {
            throw e;
        }
    }
778198
public ImageHelper load(ImageView v, ProgressBar progress, String url) {
        return load(v, progress, url, null);
    }
148522
private void scanResources() {

		Set<String> resourcePaths = getResourcesToScan();
		for (String resourcePath : resourcePaths) {

			scanResource(resourcePath);
		}

		logger.info("{} JARs scanned", resourcePaths.size());

	}
1029056
List<ResourceSet> computeResourceSetList() {
        List<ResourceSet> sourceFolderSets = resSetSupplier.get();
        int size = sourceFolderSets.size() + 4;
        if (libraries != null) {
            size += libraries.getArtifacts().size();
        }

        List<ResourceSet> resourceSetList = Lists.newArrayListWithExpectedSize(size);

        // add at the beginning since the libraries are less important than the folder based
        // resource sets.
        // get the dependencies first
        if (libraries != null) {
            Set<ResolvedArtifactResult> libArtifacts = libraries.getArtifacts();
            // the order of the artifact is descending order, so we need to reverse it.
            for (ResolvedArtifactResult artifact : libArtifacts) {
                ResourceSet resourceSet =
                        new ResourceSet(
                                MergeManifests.getArtifactName(artifact),
                                null,
                                null,
                                validateEnabled);
                resourceSet.setFromDependency(true);
                resourceSet.addSource(artifact.getFile());

                // add to 0 always, since we need to reverse the order.
                resourceSetList.add(0,resourceSet);
            }
        }

        // add the folder based next
        resourceSetList.addAll(sourceFolderSets);

        // We add the generated folders to the main set
        List<File> generatedResFolders = Lists.newArrayList();

        generatedResFolders.addAll(renderscriptResOutputDir.getFiles());
        generatedResFolders.addAll(generatedResOutputDir.getFiles());

        // add the generated files to the main set.
        final ResourceSet mainResourceSet = sourceFolderSets.get(0);
        assert mainResourceSet.getConfigName().equals(BuilderConstants.MAIN);
        mainResourceSet.addSources(generatedResFolders);

        return resourceSetList;
    }
734794
public void setResourceGroups(java.util.Collection<ResourceGroup> resourceGroups) {
        if (resourceGroups == null) {
            this.resourceGroups = null;
            return;
        }

        this.resourceGroups = new java.util.ArrayList<ResourceGroup>(resourceGroups);
    }
765542
private void loadFile(String resourcePath) {
		InputStream stream = getClass().getResourceAsStream(resourcePath);
		if (stream == null) {
			throw new IllegalArgumentException(resourcePath + " is missing");
		}
		BufferedReader lineReader = null;
		try {
			lineReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(stream)));
			stream = null;
			// skip the first line header
			lineReader.readLine();
			while (true) {
				String line = lineReader.readLine();
				if (line == null) {
					break;
				}
				// parse the CSV file. The CSV file contains three elements per row
				String[] parsed = line.split(",");
				if (parsed.length < 3) {
					// ignore invalid entries
					continue;
				}
				String name = parsed[0];
				String mimeType = parsed[1];
				if (mimeType.isEmpty()) {
					continue;
				}
				String reference = parsed[2];
				// fix problem in the CSV file provided by IANA such as G719,audio/G719,"[RFC5404][RFC Errata 3245]"
				if (reference.startsWith("\"")) {
					String nextLine = lineReader.readLine();
					nextLine = nextLine.replaceAll("\\s+", "");
					reference += nextLine;
				}
				IanaEntry ianaEntry = new IanaEntry(name, mimeType, parseReference(reference));
				entryMap.put(mimeType, ianaEntry);
			}
		} catch (IOException ioe) {
			throw new RuntimeException("Error when loading " + resourcePath, ioe);
		} finally {
			closeQuietly(lineReader);
			closeQuietly(stream);
		}
	}
113289
public static void progress(boolean visible, Panel container) {
        loader.setType(LoaderType.PROGRESS);
        loader.setContainer(container);
        if (visible) {
            loader.show();
        } else {
            loader.hide();
        }
    }