Creates a new deployment for the path. If the path is a directory the content will be deployed exploded using
the file system location.

@param content the path containing the content

@return the deployment
3791
public static Deployment of(final Path content) {
        final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("content", content));
        return new Deployment(deploymentContent, null);
    }
164864
private Container createContainer(final FedoraSession session, final String path) {
        try {
            final Node node = findOrCreateNode(session, path, NT_FOLDER);

            if (node.canAddMixin(FEDORA_RESOURCE)) {
                node.addMixin(FEDORA_RESOURCE);
                node.addMixin(FEDORA_CONTAINER);
            }

            return new ContainerImpl(node);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
799501
public FileAppendWriter write(String content) {
        try {
            writer.write(content);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return this;
    }
1112550
public function createFile(string $name, string $content = ""): File {
		$url = Paths::normalize(Paths::appendPath($this->getUrl(), $name));
		$this->manager->put($url, $content);

		return new File($url);
	}
728169
public static Deployment of(final URL url) {
        final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("url", url));
        return new Deployment(deploymentContent, null);
    }
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);
        }
    }
120947
public void deployAll(String applicationName, Path directory) throws IOException {
        this.applicationName = applicationName;

        if (Files.isDirectory(directory)) {
            Files.list(directory)
                .filter(ResourceFilter::filterKubernetesResource)
                .map(p -> {
                    try {
                        return Files.newInputStream(p);
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                })
                .forEach(is -> {
                    try {
                        deploy(is);
                        is.close();
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                });
        } else {
            throw new IllegalArgumentException(String.format("%s should be a directory", directory));
        }
    }
1196447
public static BinaryDocument create(String id, ByteBuf content) {
        return new BinaryDocument(id, 0, content, 0, null);
    }
1332931
public void setContent(final WComponent content) {
		getOrCreateComponentModel().content = content;

		// There should only be one content.
		holder.removeAll();
		holder.add(content);
	}
283239
public Container deploy() throws DeploymentException {
        Archive deployment = createDefaultDeployment();
        if (deployment == null) {
            throw new DeploymentException("Unable to create default deployment");
        } else {
            return deploy(deployment);
        }
    }
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);
        }
    }
642501
@Nullable
    protected Uri createAttachmentFromString(@NonNull Context context, @NonNull String name, @NonNull String content) {
        final File cache = new File(context.getCacheDir(), name);
        try {
            IOUtils.writeStringToFile(cache, content);
            return AcraContentProvider.getUriForFile(context, cache);
        } catch (IOException ignored) {
        }
        return null;
    }
12625
public static JsonLongDocument create(String id, Long content) {
        return new JsonLongDocument(id, 0, content, 0, null);
    }
1275060
public static UniversalIdIntQueueMessage newInstance(byte[] content) {
        UniversalIdIntQueueMessage msg = newInstance();
        msg.setContent(content);
        return msg;
    }
1355589
function (content) {
      var innerSelf = this;

      return self._readFile()
        .then(function (fileContent) {
          fileContent.instances = fileContent.instances || {};
          fileContent.instances[innerSelf._id] = _.assign(fileContent.instances[innerSelf._id] || {}, content);

          return self._writeFile(fileContent);
        });
    }
1154538
public Xml addContent(Content content) {
        if(current == null) {
            throw new XmlModelException("Content can not be attached as root element: " + content.toString());
        }
        content.setParent(current);
        current.addChildElement(content);
        return this;
    }
465650
public static JsonDoubleDocument create(String id, Double content) {
        return new JsonDoubleDocument(id, 0, content, 0, null);
    }