Updates given outputFiles map with class name patterns matching given
java source names

@param resources
java sources
@param outLocations
key is src root, value is output location this directory
@param fbProject
199671
private void collectClassFiles(List<WorkItem> resources, Map<IPath, IPath> outLocations, Project fbProject) {
        for (WorkItem workItem : resources) {
            workItem.addFilesToProject(fbProject, outLocations);
        }
    }
1186152
private static void mapResource(WorkItem resource, Map<IProject, List<WorkItem>> projectsMap, boolean checkJavaProject) {

        IProject project = resource.getProject();
        if (checkJavaProject && !ProjectUtilities.isJavaProject(project)) {
            // non java projects: can happen only for changesets
            return;
        }
        List<WorkItem> resources = projectsMap.get(project);
        if (resources == null) {
            resources = new ArrayList<>();
            projectsMap.put(project, resources);
        }
        // do not need to check for duplicates, cause user cannot select
        // the same element twice
        if (!containsParents(resources, resource)) {
            resources.add(resource);
        }
    }
314167
private void readResources(Project project, HashMap<BigInteger, ProjectCalendar> calendarMap)
   {
      Project.Resources resources = project.getResources();
      if (resources != null)
      {
         for (Project.Resources.Resource resource : resources.getResource())
         {
            readResource(resource, calendarMap);
         }
      }
   }
235761
public void deployApplication(String applicationName, String... classpathLocations) throws IOException {

        final List<URL> classpathElements = Arrays.stream(classpathLocations)
            .map(classpath -> Thread.currentThread().getContextClassLoader().getResource(classpath))
            .collect(Collectors.toList());

        deployApplication(applicationName, classpathElements.toArray(new URL[classpathElements.size()]));
    }
798858
public void writePropertiesToFile(File outputFile) throws MojoExecutionException {// NOSONAR
        stripOutReservedProperties();
        //TODO if jmeter.properties write properties that are required for plugin
        if (properties.isEmpty()) {
            return;
        }
        try {
            try (FileOutputStream writeOutFinalPropertiesFile = new FileOutputStream(outputFile)) {
                properties.store(writeOutFinalPropertiesFile, null);
                writeOutFinalPropertiesFile.flush();
            }
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
151839
@Override
  @SuppressForbidden("legitimate sysstreams.")
  public void setOuter(JUnit4 task) {
    this.seed = task.getSeed();

    if (outputFile != null) {
      try {
        Files.createParentDirs(outputFile);
        final CharSink charSink;
        if (append) {
          charSink = Files.asCharSink(outputFile, Charsets.UTF_8, FileWriteMode.APPEND);
        } else {
          charSink = Files.asCharSink(outputFile, Charsets.UTF_8);
        }
        this.output = charSink.openBufferedStream();
      } catch (IOException e) {
        throw new BuildException(e);
      }
    } else {
      if (!UNICODE_ENCODINGS.contains(Charset.defaultCharset().name())) {
        task.log("Your default console's encoding may not display certain" +
            " unicode glyphs: " + Charset.defaultCharset().name(), 
            Project.MSG_INFO);
      }
      output = new LineFlushingWriter(new OutputStreamWriter(System.out, Charset.defaultCharset())) {
        @Override
        // Don't close the underlying stream, just flush.
        public void close() throws IOException {
          flush();
        }
      };
    }
  }
1232962
public void setSources(java.util.Collection<InputSource> sources) {
        if (sources == null) {
            this.sources = null;
            return;
        }

        this.sources = new java.util.ArrayList<InputSource>(sources);
    }
55408
public void setOutputDirectory( String outputDirectory ) {

		// Update the configuration
		this.logger.fine( "Output directory is now... " + outputDirectory );
		this.outputDIR = Utils.isEmptyOrWhitespaces( outputDirectory ) ? null : new File( outputDirectory );

		// Generate the files
		if( this.outputDIR != null && this.dm != null ) {
			for( ManagedApplication ma : this.dm.applicationMngr().getManagedApplications())
				application( ma.getApplication(), EventType.CHANGED );
		}
	}


	/**
	 * Binds the DM.
	 * @param dm
	 */
	public void bindManager( Manager dm ) {

		synchronized( this.generationLock ) {
			this.logger.fine( "The DM is now available in the templating manager." );
			this.dm = dm;
		}
	}


	/**
	 * Unbinds the DM.
	 * @param dm
	 */
	public void unbindManager( Manager dm ) {

		synchronized( this.generationLock ) {
			this.logger.fine( "The DM is NOT available anymore in the templating manager." );
			this.dm = null;
		}
	}


	// iPojo life cycle


	/**
	 * Starts the templating manager (invoked by iPojo).
	 */
	public void start() {

		synchronized( this.watcherLock ) {
			this.logger.config( "The templating manager is starting..." );
			resetWatcher();
		}
	}


	/**
	 * Stops the templating manager (invoked by iPojo).
	 */
	public void stop() {

		synchronized( this.watcherLock ) {
			this.logger.config( "The templating manager is stopping..." );
			stopWatcher();
		}
	}


	// Inherited methods


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener#getId()
	 */
	@Override
	public String getId() {
		return ID;
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #application(net.roboconf.core.model.beans.Application, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void application( Application application, EventType eventType ) {

		if( this.outputDIR == null ) {
			this.logger.warning( "Generation from templates is skipped. Invalid output directory." );

		} else if( eventType == EventType.DELETED ) {
			synchronized( this.generationLock ) {
				TemplateUtils.deleteGeneratedFiles( application, this.outputDIR );
			}

		} else {
			generate( application );
		}
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #applicationTemplate(net.roboconf.core.model.beans.ApplicationTemplate, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void applicationTemplate( ApplicationTemplate tpl, EventType eventType ) {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #instance(net.roboconf.core.model.beans.Instance, net.roboconf.core.model.beans.Application, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void instance( Instance instance, Application application, EventType eventType ) {
		application( application, EventType.CHANGED );
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #raw(java.lang.String, java.lang.Object[])
	 */
	@Override
	public void raw( String message, Object... data ) {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #enableNotifications()
	 */
	@Override
	public void enableNotifications() {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #disableNotifications()
	 */
	@Override
	public void disableNotifications() {
		// nothing
	}
370669
private void writeResources() throws IOException
   {
      writeAttributeTypes("resource_types", ResourceField.values());

      m_writer.writeStartList("resources");
      for (Resource resource : m_projectFile.getResources())
      {
         writeFields(null, resource, ResourceField.values());
      }
      m_writer.writeEndList();
   }
1285760
public void setOutputs(java.util.Map<String, java.util.List<String>> outputs) {
        this.outputs = outputs;
    }
1347050
public static void compile(Class<?> cls, File outputPath) {
        if (outputPath == null) {
            throw new NullPointerException("Param 'outputPath' is null.");
        }
        if (!outputPath.isDirectory()) {
            throw new RuntimeException("Param 'outputPath' value should be a path directory. path=" + outputPath);
        }

    }
354210
protected void addLinkedResources(String path, GeneratorContext context, FilePathMapping fMapping) {
		addLinkedResources(path, context, Arrays.asList(fMapping));
	}
542327
public void writeFieldResources(String strClassName)
    {
    	boolean bResourceListBundle = ResourceTypeField.LIST_RESOURCE_BUNDLE.equals(this.getRecord(ProgramControl.PROGRAM_CONTROL_FILE).getField(ProgramControl.RESOURCE_TYPE).toString());
        Record recClassInfo = this.getMainRecord();
        String strPackage = this.getPackage(bResourceListBundle ? CodeType.RESOURCE_CODE : CodeType.RESOURCE_PROPERTIES);
    // Now, write the field resources (descriptions)
        FieldStuff fieldStuff = new FieldStuff();
        String strBaseClass = "ListResourceBundle";
        String strClassSuffix = "Resources";
        boolean bResourceOnlyFile = false;
        if (RESOURCE_CLASS.equals(recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).toString()))
            bResourceOnlyFile = true;     // Resource only class
        if (bResourceOnlyFile)
            if (strClassName.endsWith(strClassSuffix))
                strClassSuffix = "";
        if (!bResourceListBundle)
        	strClassSuffix += ".properties";
        
        this.writeHeading(strClassName + strClassSuffix, strPackage, bResourceListBundle ? ClassProject.CodeType.RESOURCE_CODE : ClassProject.CodeType.RESOURCE_PROPERTIES);
        if (bResourceListBundle)
        {
	        m_StreamOut.writeit("package " + strPackage + ";\n\n");
	
	        m_StreamOut.writeit("import java.util.*;\n\n");
	        m_StreamOut.writeit("public class "+ strClassName + strClassSuffix + " extends " + strBaseClass + "\n");
	        m_StreamOut.writeit("{\n");
	        m_StreamOut.setTabs(+1);
	        m_StreamOut.writeit("public Object[][] getContents()\n");
	        m_StreamOut.writeit("{\n");
	        m_StreamOut.writeit("\treturn contents;\n");
	        m_StreamOut.writeit("}\n");
	
	        m_StreamOut.writeit("\n");
	        m_StreamOut.writeit("// To Localize this, just change the strings in the second column\n");
	        m_StreamOut.writeit("protected static final Object[][] contents =\n");
	        m_StreamOut.writeit("{\n");
	        m_StreamOut.setTabs(-1);
        }
        int count = 0;
        try   {
            Record recFieldData = this.getRecord(FieldData.FIELD_DATA_FILE);
            if (!bResourceOnlyFile)
            {
                recFieldData.close();
                while (recFieldData.hasNext())
                {
                    recFieldData.next();

                    this.getFieldData(fieldStuff, false);

                    {
                        if (bResourceListBundle)
                            if (count > 0)
                                m_StreamOut.writeit(",");
                        if (count > 0)
                            m_StreamOut.writeit("\n");
                        if (fieldStuff.strFieldDesc.equals("null"))
                            fieldStuff.strFieldDesc = fieldStuff.strFieldName;
                        if (bResourceListBundle)
                        	m_StreamOut.writeit("\t\t{\"" + ResourcesUtilities.fixPropertyKey(fieldStuff.strFieldName) + "\", " + ResourcesUtilities.fixPropertyValue(fieldStuff.strFieldDesc, bResourceListBundle) + "}");
                        else
                        	m_StreamOut.writeit(ResourcesUtilities.fixPropertyKey(fieldStuff.strFieldName) + "=" + ResourcesUtilities.fixPropertyValue(fieldStuff.strFieldDesc, bResourceListBundle));
                        count++;
                    }
                }
    // Now write out the tips
                this.readRecordClass(strClassName);     // Return the record to the original position
            }
            String strTipSuffix = DBConstants.TIP;
            if (bResourceOnlyFile)
                strTipSuffix = "";

            recFieldData.close();
            while (recFieldData.hasNext())
            {
                recFieldData.next();
                String strPre = DBConstants.BLANK;
                if (recFieldData.getField(FieldData.FIELD_NAME).getString().equals(recFieldData.getField(FieldData.BASE_FIELD_NAME).getString()))
                	if (recFieldData.getField(FieldData.FIELD_DESC_VERTICAL).getLength() == 0)
                	{
                        if (bResourceListBundle)
                        	strPre = "//";
                        else
                        	strPre = "# ";
                	}

                this.getFieldData(fieldStuff, false);

                if (fieldStuff.strFieldTip != null)
                {
                    if (bResourceListBundle)
                        if (count > 0)
                            m_StreamOut.writeit(",");
                    if (count > 0)
                        m_StreamOut.writeit("\n");

                    if (bResourceListBundle)
                    	m_StreamOut.writeit(strPre + "\t\t{\"" + ResourcesUtilities.fixPropertyKey(fieldStuff.strFieldName + strTipSuffix) + "\", " + ResourcesUtilities.fixPropertyValue(fieldStuff.strFieldTip, bResourceListBundle) + "}");
                    else
                    	m_StreamOut.writeit(strPre + ResourcesUtilities.fixPropertyKey(fieldStuff.strFieldName + strTipSuffix) + "=" + ResourcesUtilities.fixPropertyValue(fieldStuff.strFieldTip, bResourceListBundle));
                    count++;
                }
            }

            if (bResourceListBundle)
            {
	            m_StreamOut.writeit("\n");
	            m_StreamOut.setTabs(+1);
	            m_StreamOut.writeit("// END OF MATERIAL TO LOCALIZE\n");
	            m_StreamOut.writeit("};\n");
            }
            recFieldData.close();
            this.writeEndCode(bResourceListBundle);
        } catch (DBException ex)   {
            ex.printStackTrace();
        }
        this.readRecordClass(strClassName);     // Return the record to the original position
     }
1217418
@GwtIncompatible("Unnecessary")
  private void outputSourceMap(B options, String associatedName) throws IOException {
    if (Strings.isNullOrEmpty(options.sourceMapOutputPath)
        || options.sourceMapOutputPath.equals("/dev/null")) {
      return;
    }

    String outName = expandSourceMapPath(options, null);
    maybeCreateDirsForPath(outName);
    try (Writer out = fileNameToOutputWriter2(outName)) {
      compiler.getSourceMap().appendTo(out, associatedName);
    }
  }
744968
public static void copyResourceFile(String source, Path target) throws IOException {
        InputStream resource = FsCrawlerUtil.class.getResourceAsStream(source);
        FileUtils.copyInputStreamToFile(resource, target.toFile());
    }
497042
static File getOutputDirectory(MavenProject rootModule) {
        String directoryName = rootModule.getBuild().getDirectory() + "/" + OUTPUT_DIRECTORY;
        File directory = new File(directoryName);
        directory.mkdirs();
        return directory;
    }
65354
public void setReferencedByResources(java.util.Collection<String> referencedByResources) {
        if (referencedByResources == null) {
            this.referencedByResources = null;
            return;
        }

        this.referencedByResources = new java.util.ArrayList<String>(referencedByResources);
    }