本文整理匯總了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);
}
}
}