本文整理汇总了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();
}
示例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);
}
}
}
示例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);
}
}
}