Adds the basic Images and Files to the book that are the minimum requirements to build it.

@param buildData Information and data structures for the build.
347472
protected void addBookBaseFilesAndImages(final BuildData buildData) throws BuildProcessingException {
        final String pressgangWebsiteJS = buildPressGangWebsiteJS(buildData);

        addToZip(buildData.getBookImagesFolder() + "icon.svg", ResourceUtilities.resourceFileToByteArray("/", "icon.svg"), buildData);
        addToZip(buildData.getBookFilesFolder() + "pressgang_website.js", pressgangWebsiteJS, buildData);
    }
427941
@SuppressWarnings("unchecked")
    private void processImageLocations(final BuildData buildData) {
        final List<Integer> topicIds = buildData.getBuildDatabase().getTopicIds();
        for (final Integer topicId : topicIds) {
            final ITopicNode topicNode = buildData.getBuildDatabase().getTopicNodesForTopicID(topicId).get(0);
            final BaseTopicWrapper<?> topic = topicNode.getTopic();

            if (log.isDebugEnabled()) log.debug("\tProcessing SpecTopic " + topicNode.getId() + (topicNode.getRevision() != null ? (", " +
                    "Revision " + topicNode.getRevision()) : ""));

            /*
             * Images have to be in the image folder in Publican. Here we loop through all the imagedata elements and fix up any
             * reference to an image that is not in the images folder.
             */
            final List<Node> images = XMLUtilities.getChildNodes(topicNode.getXMLDocument(), "imagedata", "inlinegraphic");

            for (final Node imageNode : images) {
                final NamedNodeMap attributes = imageNode.getAttributes();
                if (attributes != null) {
                    final Node fileRefAttribute = attributes.getNamedItem("fileref");

                    if (fileRefAttribute != null && (fileRefAttribute.getNodeValue() == null || fileRefAttribute.getNodeValue().isEmpty()
                    )) {
                        fileRefAttribute.setNodeValue("images/" + BuilderConstants.FAILPENGUIN_PNG_NAME + ".jpg");
                        buildData.getImageLocations().add(new TopicImageData(topic, fileRefAttribute.getNodeValue()));
                    } else if (fileRefAttribute != null && fileRefAttribute.getNodeValue() != null) {
                        final String fileRefValue = fileRefAttribute.getNodeValue();
                        if (BuilderConstants.IMAGE_FILE_REF_PATTERN.matcher(fileRefValue).matches()) {
                            if (fileRefValue.startsWith("./images/")) {
                                fileRefAttribute.setNodeValue(fileRefValue.substring(2));
                            } else if (!fileRefValue.startsWith("images/")) {
                                fileRefAttribute.setNodeValue("images/" + fileRefValue);
                            }

                            buildData.getImageLocations().add(new TopicImageData(topic, fileRefAttribute.getNodeValue()));
                        } else if (!BuilderConstants.COMMON_CONTENT_FILE_REF_PATTERN.matcher(fileRefValue).matches()) {
                            // The file isn't common content or a pressgang image so mark it as a missing image.
                            fileRefAttribute.setNodeValue("images/" + BuilderConstants.FAILPENGUIN_PNG_NAME + ".jpg");
                            buildData.getImageLocations().add(new TopicImageData(topic, fileRefAttribute.getNodeValue()));
                        }
                    }
                }
            }
        }
    }
269571
private void buildData(String path, WebPage page, List<TreePageData> data, WebSiteRequest req) throws IOException, SQLException {
		if(isVisible(page)) {
			if(path.length()>0) path=path+'/'+page.getShortTitle();
			else path=page.getShortTitle();
			WebPage[] pages=page.getCachedPages(req);
			int len=pages.length;
			data.add(
				new TreePageData(
					len>0 ? (path+'/') : path,
					req.getContextPath()+req.getURL(page),
					page.getDescription()
				)
			);
			for(int c=0; c<len; c++) buildData(path, pages[c], data, req);
		}
	}
1364052
public void setImagesData(List data) {
        if (data == null || data.isEmpty()) {
            this.setVisibility(GONE);
            return;
        } else {
            this.setVisibility(VISIBLE);
        }

        if (mMaxSize > 0 && data.size() > mMaxSize) {
            data = data.subList(0, mMaxSize);
        }

        int[] gridParam = calculateGridParam(data.size());
        mRowCount = gridParam[0];
        mColumnCount = gridParam[1];
        if (mImgDataList == null) {
            int i = 0;
            while (i < data.size()) {
                ImageView iv = getImageView(i);
                if (iv == null)
                    return;
                addView(iv, generateDefaultLayoutParams());
                i++;
            }
        } else {
            int oldViewCount = mImgDataList.size();
            int newViewCount = data.size();
            if (oldViewCount > newViewCount) {
                removeViews(newViewCount, oldViewCount - newViewCount);
            } else if (oldViewCount < newViewCount) {
                for (int i = oldViewCount; i < newViewCount; i++) {
                    ImageView iv = getImageView(i);
                    if (iv == null) {
                        return;
                    }
                    addView(iv, generateDefaultLayoutParams());
                }
            }
        }
        mImgDataList = data;
        requestLayout();
    }
266751
private void initData(byte[] fileData) {
		traceData = fileData;
		if (isABI()) {
			setIndex();
			setBasecalls();
			setQcalls();
			setSeq();
			setTraces();
		} else throw new IllegalArgumentException("Not a valid ABI file.");
	}
534547
protected void addToZip(final String path, final String file, BuildData buildData) throws BuildProcessingException {
        try {
            buildData.getOutputFiles().put(path, file.getBytes(ENCODING));
        } catch (UnsupportedEncodingException e) {
            /* UTF-8 is a valid format so this should exception should never get thrown */
            throw new BuildProcessingException(e);
        }
    }
735649
public void addData(final Data DATA) {
        sum += DATA.getValue();
        window.add(DATA);
        if (window.size() > numberPeriod) {
            sum -= window.remove().getValue();
        }
    }
1171085
private void fillDataStructures() {
        final ITreeData treeData = mRtx.getNode();
        mInOrder.put(treeData, true);
        mDescendants.put(treeData, 1L);
    }
738791
protected void addImagesToBook(final BuildData buildData, final String locale, final String imageFolder, boolean revertToDefaultLocale,
            boolean logErrors) {
        // Load the database constants
        final byte[] failpenguinPng = blobConstantProvider.getBlobConstant(
                buildData.getServerEntities().getFailPenguinBlobConstantId()).getValue();

        // Download the image files that were identified in the processing stage
        float imageProgress = 0;
        final float imageTotal = buildData.getImageLocations().size();
        final int showPercent = 10;
        int lastPercent = 0;

        for (final TopicImageData imageLocation : buildData.getImageLocations()) {
            // Check if the app should be shutdown
            if (isShuttingDown.get()) {
                return;
            }

            boolean success = false;

            final int extensionIndex = imageLocation.getImageName().lastIndexOf(".");
            final int pathIndex = imageLocation.getImageName().lastIndexOf("/");
            final int hypenIndex = imageLocation.getImageName().lastIndexOf("-");

            if (    /* characters were found */
                    extensionIndex != -1 && pathIndex != -1
                    /* the path character was found before the extension */ && extensionIndex > pathIndex) {
                try {
                    /*
                     * The file name minus the extension should be an integer that references an ImageFile record ID.
                     */
                    final String imageID;
                    if (hypenIndex != -1) {
                        imageID = imageLocation.getImageName().substring(pathIndex + 1, Math.min(extensionIndex, hypenIndex));
                    } else {
                        imageID = imageLocation.getImageName().substring(pathIndex + 1, extensionIndex);
                    }

                    /*
                     * If the image is the failpenguin the that means that an error has already occurred most likely from not
                     * specifying an image file at all.
                     */
                    if (imageID.equals(BuilderConstants.FAILPENGUIN_PNG_NAME)) {
                        success = false;
                        buildData.getErrorDatabase().addError(imageLocation.getTopic(), ErrorType.INVALID_IMAGES,
                                "No image filename specified. Must be in the format [ImageFileID].extension e.g. 123.png, " +
                                        "" + "or images/321.jpg");
                    } else {
                        final ImageWrapper imageFile = imageProvider.getImage(Integer.parseInt(imageID));
                        // TODO Uncomment this once Image Revisions are fixed.
//                        if (imageLocation.getRevision() == null) {
//                            imageFile = imageProvider.getImage(Integer.parseInt(imageID));
//                        } else {
//                            imageFile = imageProvider.getImage(Integer.parseInt(imageID), imageLocation.getRevision());
//                        }

                        // Find the image that matches this locale. If the locale isn't found then use the default locale
                        LanguageImageWrapper languageImageFile = null;
                        if (imageFile.getLanguageImages() != null && imageFile.getLanguageImages().getItems() != null) {
                            final List<LanguageImageWrapper> languageImages = imageFile.getLanguageImages().getItems();
                            for (final LanguageImageWrapper image : languageImages) {
                                if (image.getLocale().getValue().equals(locale)) {
                                    languageImageFile = image;
                                    break;
                                } else if (revertToDefaultLocale && image.getLocale().getValue().equals(
                                        buildData.getDefaultLocale()) && languageImageFile == null) {
                                    languageImageFile = image;
                                }
                            }
                        }

                        if (languageImageFile != null && languageImageFile.getImageData() != null) {
                            success = true;
                            addToZip(buildData.getBookLocaleFolder() + imageLocation.getImageName(), languageImageFile.getImageData(),
                                    buildData);
                        } else if (logErrors) {
                            buildData.getErrorDatabase().addError(imageLocation.getTopic(), ErrorType.INVALID_IMAGES,
                                    "ImageFile ID " + imageID + " from image location " + imageLocation.getImageName() + " was not found!");
                        }
                    }
                } catch (final NumberFormatException ex) {
                    success = false;
                    if (logErrors) {
                        buildData.getErrorDatabase().addError(imageLocation.getTopic(), ErrorType.INVALID_IMAGES,
                                imageLocation.getImageName() + " is not a valid image. Must be in the format [ImageFileID].extension e.g." +
                                        " 123" +
                                        ".png, or images/321.jpg");
                        log.debug("", ex);
                    }
                } catch (final Exception ex) {
                    success = false;
                    if (logErrors) {
                        buildData.getErrorDatabase().addError(imageLocation.getTopic(), ErrorType.INVALID_IMAGES,
                                imageLocation.getImageName() + " is not a valid image. Must be in the format [ImageFileID].extension e.g." +
                                        " 123" +
                                        ".png, or images/321.jpg");
                        log.debug("", ex);
                    }
                }
            }

            // Put in a place holder in the image couldn't be found
            if (logErrors && !success) {
                buildData.getOutputFiles().put(imageFolder + imageLocation.getImageName(), failpenguinPng);
            }

            final int progress = Math.round(imageProgress / imageTotal * 100);
            if (progress - lastPercent >= showPercent) {
                lastPercent = progress;
                log.info("\tDownloading " + locale + " Images " + progress + "% done");
            }

            ++imageProgress;
        }
    }
330216
public void append(final char[] data) {
        if (data == null) {
            return;
        }
        provideCapacity(length + data.length);
        System.arraycopy(data, 0, c, length, data.length);
        length += data.length;
    }
948234
protected void addHttpData(InterfaceHttpData data) {
        if (data == null) {
            return;
        }
        List<InterfaceHttpData> datas = bodyMapHttpData.get(data.getName());
        if (datas == null) {
            datas = new ArrayList<InterfaceHttpData>(1);
            bodyMapHttpData.put(data.getName(), datas);
        }
        datas.add(data);
        bodyListHttpData.add(data);
    }
1009103
protected void addToZip(final String path, final byte[] data, final BuildData buildData) {
        buildData.getOutputFiles().put(path, data);
    }
1307018
public function main()
    {
        if ($this->property === null) {
            throw new BuildException("property attribute required", $this->getLocation());
        }

        if ($this->file === null) {
            throw new BuildException("file attribute required", $this->getLocation());
        }

        $this->getProject()->setNewProperty(
            $this->property,
            $this->removeExtension($this->file->getName(), $this->suffix)
        );
    }
533820
protected void buildData(String[] data, boolean validateOnly) {

        if (data == null) {
            return;
        }

        int length = data.length;

        for (int i = 0; i < length; i++) {
            addAddressToList(data[i], validateOnly);
        }

    }
421236
public function addIncluded(Data $newData)
    {
        $this->included[$newData->getType()][$newData->getId()] = $newData;
    }
602759
public void setImage(final GVRImage imageData)
    {
        mImage = imageData;
        if (imageData != null)
            NativeTexture.setImage(getNative(), imageData, imageData.getNative());
        else
            NativeTexture.setImage(getNative(), null, 0);
    }
22900
public function setImage(string $imageData) : void
    {
        $url = $this->uploadImage('communityProfileImage', $imageData);

        $this->set([
            'profileImage' => [
                'sourceUrl' => $url
            ]
        ]);
    }