Saves content to the specified location.

@param content
@param location
@return
431170
@Override
    public boolean save(String content, String location) {
        return save(content, Charsets.UTF_8, location);
    }
351401
public Document createRaw(@NonNull String content) {
      return createRaw(StringUtils.EMPTY, content, defaultLanguage, Collections.emptyMap());
   }
503277
public void setContent(PaperContent content)
	{
		if (myContent != content)
		{
			if (null != myContent)
			{
				myContent.unattach();
			}
			myContent = content;
		}
		if (null != myContent)
		{
			myContent.attachTo(this);
		}
	}
1252278
public String copyScriptContent(final ExecutionContext executionContext, final String s,
                                    final INodeEntry node, final String destination) throws
                                                           FileCopierException {
        return copyFile(executionContext, null, null, s, node, destination);
    }
1116014
private function getContentCreateData(?Location $location): ContentCreateData
    {
        $languages = $this->languageService->loadLanguages();
        $language = 1 === \count($languages)
            ? array_shift($languages)
            : null;

        return new ContentCreateData(null, $location, $language);
    }
1131842
@PUT
    public Response putContent(@PathParam("spaceID") String spaceID,
                               @PathParam("contentID") String contentID,
                               @QueryParam("storeID") String storeID,
                               @HeaderParam(COPY_SOURCE_HEADER) String copySource,
                               @HeaderParam(COPY_SOURCE_STORE_HEADER) String sourceStoreID) {
        if (null != copySource) {
            return copyContent(spaceID, contentID, storeID, sourceStoreID, copySource);

        } else {
            return addContent(spaceID, contentID, storeID);
        }
    }
583951
public static void saveTo(String path, byte[] content) {
        InputStream is = null;
        try {
            is = new ByteArrayInputStream(content);
            saveTo(path, is);
        } finally {
            closeQuietly(is);
        }
    }
1173916
public void saveContent(
        JavaScriptObject newValues,
        final I_CmsStringCallback onSuccess,
        final I_CmsErrorCallback onFailure) {

        m_apiRoot.getRpcHelper().executeRpc(
            CmsXmlContentUgcApi.SERVICE.saveContent(
                m_content.getSessionId(),
                CmsJsUtils.convertJsObjectToMap(newValues),
                new AsyncCallback<Map<String, String>>() {

                    @SuppressWarnings("synthetic-access")
                    public void onFailure(Throwable caught) {

                        CmsUgcException formException = (CmsUgcException)caught;
                        m_apiRoot.handleError(formException, onFailure);
                    }

                    public void onSuccess(Map<String, String> result) {

                        if ((result == null) || result.isEmpty()) {
                            onSuccess.call("");
                        } else {
                            JavaScriptObject validationErrorsJso = CmsJsUtils.convertMapToJsObject(result);
                            onFailure.call(CmsUgcConstants.ErrorCode.errValidation.toString(), "", validationErrorsJso);
                        }
                    }
                }));

    }
309835
public CmsXmlContentErrorHandler saveContent(Map<String, String> contentValues) throws CmsUgcException {

        checkNotFinished();
        try {
            CmsFile file = m_cms.readFile(m_editResource);
            CmsXmlContent content = addContentValues(file, contentValues);
            CmsXmlContentErrorHandler errorHandler = content.validate(m_cms);
            if (!errorHandler.hasErrors()) {
                file.setContents(content.marshal());
                // the file content might have been modified during the write operation
                file = m_cms.writeFile(file);
            }

            return errorHandler;
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            throw new CmsUgcException(e, CmsUgcConstants.ErrorCode.errMisc, e.getLocalizedMessage());
        }

    }
843897
public Response andContent(Map<String, Object> content) {
        Objects.requireNonNull(content, Required.CONTENT.toString());
        this.content.putAll(content);

        return this;
    }
656932
function save(filePath, content) {
    mkpath(PATH.dirname(filePath));
    fs.writeFileSync(filePath, content);
}
648570
@Override
    public String addContent(String spaceID,
                             String contentID,
                             InputStream content,
                             String contentMimeType,
                             Map<String, String> userProperties,
                             long contentSize,
                             String checksum,
                             String storeID)
        throws ResourceException, InvalidIdException, ResourcePropertiesInvalidException {

        IdUtil.validateContentId(contentID);
        validateProperties(userProperties, "add content", spaceID, contentID);

        try {
            StorageProvider storage =
                storageProviderFactory.getStorageProvider(storeID);

            try {
                // overlay new properties on top of older extended properties
                // so that old tags and custom properties are preserved.
                // c.f. https://jira.duraspace.org/browse/DURACLOUD-757
                Map<String, String> oldUserProperties =
                    storage.getContentProperties(spaceID, contentID);
                //remove all non extended properties
                if (userProperties != null) {
                    oldUserProperties.putAll(userProperties);
                    //use old mimetype if none specified.
                    String oldMimetype =
                        oldUserProperties.remove(StorageProvider.PROPERTIES_CONTENT_MIMETYPE);
                    if (contentMimeType == null || contentMimeType.trim() == "") {
                        contentMimeType = oldMimetype;
                    }

                    oldUserProperties = StorageProviderUtil.removeCalculatedProperties(oldUserProperties);
                }

                userProperties = oldUserProperties;
            } catch (NotFoundException ex) {
                // do nothing - no properties to update
                // since file did not previous exist.
            }

            return storage.addContent(spaceID,
                                      contentID,
                                      contentMimeType,
                                      userProperties,
                                      contentSize,
                                      checksum,
                                      content);
        } catch (NotFoundException e) {
            throw new ResourceNotFoundException("add content",
                                                spaceID,
                                                contentID,
                                                e);
        } catch (ChecksumMismatchException e) {
            throw new ResourceChecksumException("add content",
                                                spaceID,
                                                contentID,
                                                e);
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("add content", spaceID, contentID, e);
        }
    }
96826
def put_content(self, content):
        
        if not isinstance(content, str):
            content = content.decode('utf-8')

        self.topic.publish(Message=content, **self.storage_args)
18450
@JsonIgnore
    public void encodeAndSetContent(String content) {
        encodeAndSetContent(content != null ? content.getBytes() : null);
    }
1349102
public static void saveFile(String path, String content) throws IOException {
        saveFile(path, content, false);
    }
799501
public FileAppendWriter write(String content) {
        try {
            writer.write(content);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return this;
    }
704488
public function createContent(Location $location = null, Campaign $campaign = null)
    {
        $connection = $this->getRestApiConnectionByLocation($location);
        $remoteContentTypes = $connection->getContentTypes();

        foreach($remoteContentTypes as $remoteContentType){
            $id = $location->getId().'-'.$remoteContentType['id'];
            $name = $remoteContentType['names']['value'][0]['#text'];
            $contentTypes[$id] = $name;
        }

        return $contentTypes;
    }