本文整理汇总了Java中org.alfresco.repo.transfer.manifest.TransferManifestHeader.setNodeCount方法的典型用法代码示例。如果您正苦于以下问题:Java TransferManifestHeader.setNodeCount方法的具体用法?Java TransferManifestHeader.setNodeCount怎么用?Java TransferManifestHeader.setNodeCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.repo.transfer.manifest.TransferManifestHeader
的用法示例。
在下文中一共展示了TransferManifestHeader.setNodeCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSnapshot
import org.alfresco.repo.transfer.manifest.TransferManifestHeader; //导入方法依赖的package包/类
private String createSnapshot(List<TransferManifestNode> nodes, String repoID) throws Exception
{
XMLTransferManifestWriter manifestWriter = new XMLTransferManifestWriter();
StringWriter output = new StringWriter();
manifestWriter.startTransferManifest(output);
TransferManifestHeader header = new TransferManifestHeader();
header.setCreatedDate(new Date());
header.setNodeCount(nodes.size());
header.setRepositoryId(repoID);
manifestWriter.writeTransferManifestHeader(header);
for (TransferManifestNode node : nodes)
{
manifestWriter.writeTransferManifestNode(node);
}
manifestWriter.endTransferManifest();
return output.toString();
}
示例2: createSnapshot
import org.alfresco.repo.transfer.manifest.TransferManifestHeader; //导入方法依赖的package包/类
private String createSnapshot(List<TransferManifestNode> nodes, boolean isSync) throws Exception
{
XMLTransferManifestWriter manifestWriter = new XMLTransferManifestWriter();
StringWriter output = new StringWriter();
manifestWriter.startTransferManifest(output);
TransferManifestHeader header = new TransferManifestHeader();
header.setCreatedDate(new Date());
header.setNodeCount(nodes.size());
header.setRepositoryId("repo 1");
header.setSync(isSync);
manifestWriter.writeTransferManifestHeader(header);
for (TransferManifestNode node : nodes)
{
manifestWriter.writeTransferManifestNode(node);
}
manifestWriter.endTransferManifest();
return output.toString();
}
示例3: serialize
import org.alfresco.repo.transfer.manifest.TransferManifestHeader; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public void serialize(Collection<NodeSnapshot> snapshots, OutputStream output) throws Exception
{
try
{
TransferManifestHeader header = new TransferManifestHeader();
header.setCreatedDate(new Date());
header.setNodeCount(snapshots.size());
header.setReadOnly(false);
header.setSync(false);
Writer writer = new OutputStreamWriter(output, "UTF-8");
XMLTransferManifestWriter transferManifestWriter = new XMLTransferManifestWriter();
transferManifestWriter.startTransferManifest(writer);
transferManifestWriter.writeTransferManifestHeader(header);
// Iterate over NodesToPublish and Serialize.
for (NodeSnapshot snapshot: snapshots)
{
if (snapshot instanceof NodeSnapshotTransferImpl)
{
NodeSnapshotTransferImpl snapshotImpl = (NodeSnapshotTransferImpl)snapshot;
transferManifestWriter.writeTransferManifestNode(snapshotImpl.getTransferNode());
}
}
transferManifestWriter.endTransferManifest();
writer.flush();
}
catch (Exception e)
{
throw new AlfrescoRuntimeException("Failed to serialize node snapshots.", e);
}
}