当前位置: 首页>>代码示例>>Java>>正文


Java TransferManifestHeader.setCreatedDate方法代码示例

本文整理汇总了Java中org.alfresco.repo.transfer.manifest.TransferManifestHeader.setCreatedDate方法的典型用法代码示例。如果您正苦于以下问题:Java TransferManifestHeader.setCreatedDate方法的具体用法?Java TransferManifestHeader.setCreatedDate怎么用?Java TransferManifestHeader.setCreatedDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.repo.transfer.manifest.TransferManifestHeader的用法示例。


在下文中一共展示了TransferManifestHeader.setCreatedDate方法的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();

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:RepoTransferReceiverImplTest.java

示例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();

}
 
开发者ID:Alfresco,项目名称:alfresco-file-transfer-receiver,代码行数:21,代码来源:FileTransferReceiverTest.java

示例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);
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:37,代码来源:StandardNodeSnapshotSerializer.java


注:本文中的org.alfresco.repo.transfer.manifest.TransferManifestHeader.setCreatedDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。