當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。