Executes the unitary resource post processing

@param bundle
the bundle
@param status
the bundle processing status
@param content
the content to process
@return the processed content
438347
private StringBuffer executeUnitaryPostProcessing(JoinableResourceBundle bundle, BundleProcessingStatus status,
			StringBuffer content, ResourceBundlePostProcessor defaultPostProcessor) {

		StringBuffer bundleData = new StringBuffer();
		status.setProcessingType(BundleProcessingStatus.FILE_PROCESSING_TYPE);
		if (null != bundle.getUnitaryPostProcessor()) {
			StringBuffer resourceData = bundle.getUnitaryPostProcessor().postProcessBundle(status, content);
			bundleData.append(resourceData);
		} else if (null != defaultPostProcessor) {
			if (LOGGER.isDebugEnabled())
				LOGGER.debug("POSTPROCESSING UNIT:" + status.getLastPathAdded());
			StringBuffer resourceData = defaultPostProcessor.postProcessBundle(status, content);
			bundleData.append(resourceData);
		} else {
			bundleData = content;
		}

		return bundleData;
	}
795058
private JoinableResourceBundleContent postProcessJoinedCompositeBundle(CompositeResourceBundle composite,
			StringBuffer content, BundleProcessingStatus status) {

		JoinableResourceBundleContent store = new JoinableResourceBundleContent();
		StringBuffer processedContent = null;
		status.setProcessingType(BundleProcessingStatus.BUNDLE_PROCESSING_TYPE);
		ResourceBundlePostProcessor bundlePostProcessor = composite.getBundlePostProcessor();
		if (null != bundlePostProcessor) {

			processedContent = bundlePostProcessor.postProcessBundle(status, content);
		} else if (null != this.compositePostProcessor) {

			processedContent = this.compositePostProcessor.postProcessBundle(status, content);
		} else {
			processedContent = content;
		}

		store.setContent(processedContent);

		return store;
	}
975838
public function response($content, $statusCode = 200)
    {
        return response()
            ->json($this->convertContent($content))
            ->setStatusCode($statusCode);
    }
573367
void handleStop(Bundle bundle) {
        if (bundle == null) {
            throw new IllegalArgumentException("Method argument bundle must not be null.");
        }

        this.logger.info("Removing infrastructure for bundle: " + bundle + "...");
            this.modelRegistrar.unregister(bundle);
            this.dispatcherServlet.disableMvc(bundle);

        this.logger.info("Infrastructure for {} removed.", bundle);
    }
1234449
@Override
	public void processBundles(T ctx, List<JoinableResourceBundle> bundles) {
		globalPreprocessor.processBundles(ctx, bundles);
	}
405317
public function respond(Status $status, $content = '')
    {
        $this->header($status);

        if (!empty($content)) {
            $this->send($content);
        }

        return $this;
    }
1305815
private void joinAndStoreBundle(JoinableResourceBundle bundle) {

		BundleProcessingStatus status = new BundleProcessingStatus(BundleProcessingStatus.FILE_PROCESSING_TYPE, bundle,
				resourceHandler, config);
		JoinableResourceBundleContent store = null;

		// Process the bundle for searching variant
		if (needToSearchForVariantInPostProcess || hasVariantPostProcessor(bundle)) {
			status.setSearchingPostProcessorVariants(true);
			joinAndPostProcessBundle(bundle, status);

			// Process the bundles
			status.setSearchingPostProcessorVariants(false);
			Map<String, VariantSet> postProcessVariants = status.getPostProcessVariants();
			if (!postProcessVariants.isEmpty()) {
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(
							"Post process variants found for bundle " + bundle.getId() + ":" + postProcessVariants);
				}
				Map<String, VariantSet> newVariants = VariantUtils.concatVariants(bundle.getVariants(),
						postProcessVariants);
				bundle.setVariants(newVariants);
				joinAndPostProcessBundle(bundle, status);
			}
		} else {
			status.setSearchingPostProcessorVariants(false);
			joinAndPostProcessBundle(bundle, status);
		}

		// Store the collected resources as a single file, both in text and
		// gzip formats.
		store = joinAndPostprocessBundle(bundle, null, status);
		storeBundle(bundle.getId(), store);

		// Set the data hascode in the bundle, in case the prefix needs to
		// be generated
		initBundleDataHashcode(bundle, store, null);

	}
1222418
protected void processBundle(Bundle bundle) {
        Properties props = readMessageRouterProps(bundle);

        if (props != null) {
            msgRouter.modified(props);
        }
    }
1112436
private void joinAndPostProcessBundle(JoinableResourceBundle bundle, BundleProcessingStatus status) {

		JoinableResourceBundleContent store;
		List<Map<String, String>> allVariants = VariantUtils.getAllVariants(bundle.getVariants());
		// Add the default bundle variant (the non variant one)
		allVariants.add(null);

		for (Map<String, String> variantMap : allVariants) {
			status.setBundleVariants(variantMap);
			String variantKey = VariantUtils.getVariantKey(variantMap);
			String name = VariantUtils.getVariantBundleName(bundle.getId(), variantKey, false);
			store = joinAndPostprocessBundle(bundle, variantMap, status);
			storeBundle(name, store);
			initBundleDataHashcode(bundle, store, variantKey);
		}
	}
75739
@Override
	protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
			throws IOException {

		JoinableResourceBundle bundle = status.getCurrentBundle();
		Charset charset = status.getJawrConfig().getResourceCharset();
		if (bundle.getLicensesPathList().isEmpty())
			return bundleData;

		ByteArrayOutputStream baOs = new ByteArrayOutputStream();
		WritableByteChannel wrChannel = Channels.newChannel(baOs);
		Writer writer = Channels.newWriter(wrChannel, charset.name());
		try (BufferedWriter bwriter = new BufferedWriter(writer)) {
			for (Iterator<String> it = bundle.getLicensesPathList().iterator(); it.hasNext();) {
				String path = it.next();
				if (LOGGER.isDebugEnabled())
					LOGGER.debug("Adding license file: " + path);

				Reader rd = null;
				try {
					rd = status.getRsReader().getResource(bundle, path);
				} catch (ResourceNotFoundException e) {
					throw new BundlingProcessException(
							"Unexpected ResourceNotFoundException when reading a sorting file [" + path + "]");
				}

				try (BufferedReader bRd = new BufferedReader(rd)) {
					// Make a buffered reader, to read line by line.
					String line = bRd.readLine();

					// Write each line and the corresponding new line.
					while (line != null) {
						bwriter.write(line);
						if (((line = bRd.readLine()) != null) || it.hasNext())
							bwriter.newLine();
					}
				}
			}
		}
		return new StringBuffer(baOs.toString(charset.name())).append(bundleData);
	}
1216502
@Override
	protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
			throws IOException {

		// Retrieve the full bundle path, so we will be able to define the
		// relative path for the css images
		String fullBundlePath = getFinalFullBundlePath(status);
		PostProcessorCssImageUrlRewriter urlRewriter = createImageUrlRewriter(status);
		return urlRewriter.rewriteUrl(status.getLastPathAdded(), fullBundlePath, bundleData.toString());
	}
216324
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle)
			throws ResourceNotFoundException {

		return getResource(bundle, resourceName, processingBundle, new ArrayList<Class<?>>());
	}
1315465
@Override
	protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
			throws IOException {

		if (minifier == null) {

			boolean keepLicence = status.getJawrConfig().getBooleanProperty(JAWR_CSS_POSTPROCESSOR_CSSMIN_KEEP_LICENCE,
					false);
			this.minifier = new CSSMinifier(keepLicence);
		}

		try {
			return minifier.minifyCSS(bundleData);
		} catch (StackOverflowError e) {
			throw new Error(
					"An error occured while processing the bundle '" + status.getCurrentBundle().getName() + "'", e);
		}

	}
1368001
public static <T> GenericResponseBuilder<T> status(Response.StatusType status) {
    if (status == null) {
      throw new NullPointerException("status:null");
    }

    return status(status.getStatusCode());
  }
626710
public function response($content, int $statusCode = 200, string $statusMessage = 'OK'): Response
    {
        $response = [
            'statusCode' => $statusCode,
            'statusMessage' => $statusMessage,
            'content' => $content,
        ];

        if ($this->config->application->debug->logRequest) {
            $this->log->addInfo('RESPONSE', $response);
        }

        // Create a response since it's an ajax
        //in order to use the current response instead of having to create a new object , this is needed for swoole servers
        $response = $this->response ?? new Response(); 
        $response->setStatusCode($statusCode, $statusMessage);
        $response->setContentType('application/vnd.api+json', 'UTF-8');
        $response->setJsonContent($content);

        return $response;
    }
416720
@Override
	public void processBundles(GlobalPreprocessingContext ctx, List<JoinableResourceBundle> bundles) {

		ResourceReaderHandler rsHandler = ctx.getRsReaderHandler();

		Set<String> resourcePaths = getResourcePaths(bundles);
		JawrConfig jawrConfig = ctx.getJawrConfig();
		Charset charset = jawrConfig.getResourceCharset();

		BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) jawrConfig.getContext()
				.getAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);

		generateSprites(rsHandler, binaryRsHandler, resourcePaths, jawrConfig, charset);

		// Update CSS resource handler
		CssSmartSpritesResourceReader cssSpriteResourceReader = new CssSmartSpritesResourceReader(
				rsHandler.getWorkingDirectory(), jawrConfig);

		updateBundlesDirtyState(bundles, cssSpriteResourceReader);

		ctx.getRsReaderHandler().addResourceReader(cssSpriteResourceReader);

		// Update image resource handler
		ResourceReaderHandler imgStreamRsHandler = binaryRsHandler.getRsReaderHandler();
		imgStreamRsHandler.addResourceReader(cssSpriteResourceReader);
	}
1171703
public byte[] postBytes(byte[] content) throws IOException {

        if (!connection.isOpen())
            connection.open();

        connection.prepare("POST");

        OutputStream os = connection.getOutputStream();
        os.write(content);

        response = connection.readInput();
        os.close();
        return getResponseBytes();
    }