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


Java XMLTransferManifestReader类代码示例

本文整理汇总了Java中org.alfresco.repo.transfer.manifest.XMLTransferManifestReader的典型用法代码示例。如果您正苦于以下问题:Java XMLTransferManifestReader类的具体用法?Java XMLTransferManifestReader怎么用?Java XMLTransferManifestReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XMLTransferManifestReader类属于org.alfresco.repo.transfer.manifest包,在下文中一共展示了XMLTransferManifestReader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deserialize

import org.alfresco.repo.transfer.manifest.XMLTransferManifestReader; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<NodeSnapshot> deserialize(InputStream input) throws Exception
{
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
    SAXParser parser = saxParserFactory.newSAXParser();
    NodeSnapshotDeserializer processor = new NodeSnapshotDeserializer();

    XMLTransferManifestReader xmlReader = new XMLTransferManifestReader(processor);
    parser.parse(input, xmlReader);
    return processor.getSnapshots();
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:15,代码来源:StandardNodeSnapshotSerializer.java

示例2: generateRequsite

import org.alfresco.repo.transfer.manifest.XMLTransferManifestReader; //导入依赖的package包/类
/**
 * Generate the requsite
 */
public void generateRequsite(String transferId, OutputStream out) throws TransferException
{
    log.debug("Generate Requsite for transfer:" + transferId);
    try
    {
        File snapshotFile = getSnapshotFile(transferId);

        if (snapshotFile.exists())
        {
            log.debug("snapshot does exist");
            SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            SAXParser parser = saxParserFactory.newSAXParser();
            OutputStreamWriter dest = new OutputStreamWriter(out, "UTF-8");

            XMLTransferRequsiteWriter writer = new XMLTransferRequsiteWriter(dest);
            TransferManifestProcessor processor = manifestProcessorFactory.getRequsiteProcessor(
                    RepoTransferReceiverImpl.this,
                    transferId,
                    writer);

            XMLTransferManifestReader reader = new XMLTransferManifestReader(processor);

            /**
             * Now run the parser
             */
            parser.parse(snapshotFile, reader);

            /**
             * And flush the destination in case any content remains in the writer.
             */
            dest.flush();

        }
        log.debug("Generate Requsite done transfer:" + transferId);

    }
    catch (Exception ex)
    {
        if (TransferException.class.isAssignableFrom(ex.getClass()))
        {
            throw (TransferException) ex;
        }
        else
        {
            throw new TransferException(MSG_ERROR_WHILE_GENERATING_REQUISITE, ex);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:52,代码来源:RepoTransferReceiverImpl.java

示例3: generateRequsite

import org.alfresco.repo.transfer.manifest.XMLTransferManifestReader; //导入依赖的package包/类
public void generateRequsite(String transferId, OutputStream requsiteStream) throws TransferException
{
    log.debug("Generate Requisite for transfer:" + transferId);
    try
    {
        File snapshotFile = getSnapshotFile(transferId);

        if (snapshotFile.exists())
        {
            log.debug("snapshot does exist");
            SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            SAXParser parser = saxParserFactory.newSAXParser();
            OutputStreamWriter dest = new OutputStreamWriter(requsiteStream, "UTF-8");

            XMLTransferRequsiteWriter writer = new XMLTransferRequsiteWriter(dest);
            TransferManifestProcessor processor = manifestProcessorFactory.getRequsiteProcessor(
                    FileTransferReceiver.this, transferId, writer);

            XMLTransferManifestReader reader = new XMLTransferManifestReader(processor);

            /**
             * Now run the parser
             */
            parser.parse(snapshotFile, reader);

            /**
             * And flush the destination in case any content remains in the writer.
             */
            dest.flush();

        }
        log.debug("Generate Requisite done transfer:" + transferId);

    }
    catch (Exception ex)
    {
        if (TransferException.class.isAssignableFrom(ex.getClass()))
        {
            throw (TransferException) ex;
        }
        else
        {
            throw new TransferException(MSG_ERROR_WHILE_GENERATING_REQUISITE, ex);
        }
    }

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


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