• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IncomingFileTransfer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getFile

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
public void getFile(){
  	
  	manager.addFileTransferListener(new FileTransferListener() {
	
	@Override
	public void fileTransferRequest(FileTransferRequest request) {
		
		IncomingFileTransfer fileTransfer = request.accept();
		
		try {
			fileTransfer.recieveFile(new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "�����ļ�"));
		} catch (XMPPException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
});
  }
 
开发者ID:phoenixNirvana,项目名称:NewCommunication-Android,代码行数:20,代码来源:XmppManager.java


示例2: fileTransferRequest

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
@Override
public void fileTransferRequest(final FileTransferRequest request)
{
	log.fine("Received file transfer request " + request);
	final String uniqueFileIdentifier = request.getDescription();
	final MD5Hash hash = new MD5Hash(uniqueFileIdentifier);
	final File temporaryIncomingFile = getTemporaryFileToStoreIncomingTransfer();
	log.fine("File " + request.getFileName() + " being saved as " + temporaryIncomingFile.getAbsolutePath());

	final IncomingFileTransfer transfer = request.accept();
	try
	{
		transfer.recieveFile(temporaryIncomingFile);
		FileTransferWorker fileTransferWorker = new FileTransferWorker(new FileTransferWorker.FileTransferWorkerDelegate()
		{
			@Override
			public void transferComplete()
			{
				fileTransferDidComplete(request.getFileName(), temporaryIncomingFile, hash, transfer);
			}

		}, transfer);
		fileTransferWorker.start();

	}
	catch (XMPPException ex)
	{
		log.log(Level.SEVERE, null, ex);
	}
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:31,代码来源:FileReceiver.java


示例3: IncomingTransfer

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
public IncomingTransfer(Module module, DeploymentID listenerID, File file, IncomingFileTransfer transfer,
								TransferHandle handle, long inactivityTimeout, long fileSize,
								boolean notifyProgress) {

	super(module, listenerID, inactivityTimeout, handle, file, fileSize, notifyProgress);
	this.transfer = transfer;
	this.listenerID = listenerID;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:9,代码来源:IncomingTransfer.java


示例4: accept

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
public void accept(IncomingTransferHandle handle, DeploymentID listenerID) {
	
	File destination = handle.getLocalFile(); 
	long inactivityTimeout = handle.getInactivityTimeout();
	boolean receiveProgressUpdates = handle.isReceiveProgressUpdate();

	LOG.debug( "Accepting transfer. Handle: " + handle + ", dest: " + destination.getAbsolutePath() );
	
	createSubFolders(destination);

	FileTransferRequest fileTransferRequest = handlersRequestMap.get( handle );
	final IncomingFileTransfer transfer = fileTransferRequest.accept();

	IncomingTransfer fileTransfer = new IncomingTransfer(module, listenerID, destination, transfer, handle,
		inactivityTimeout, fileTransferRequest.getFileSize(), receiveProgressUpdates);

	if ( receiveProgressUpdates ) {
		TransferProgress transferProgress = new TransferProgress( handle, destination.getName(),
			fileTransferRequest.getFileSize(), transfer.getStatus(), 0L, 0D, 0, false );
		Message message = 
			AbstractTransfer.createUpdateTransferProgressMessage(module.getContainerID(), listenerID, 
					transferProgress);
		module.sendMessage(message);
	}

	try {
		fileTransfer.start();
	} catch (IllegalArgumentException e) {
		LOG.error("Destination is not writable. Handle: " + handle + ", dest: " + destination.getAbsolutePath());
		reject(handle);
	}
	
	addTransfer(handle, fileTransfer);
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:35,代码来源:IncomingTransfersManager.java


示例5: putFileTransfer

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
public void putFileTransfer(String path, IncomingFileTransfer fileTransfer) {
	fileTransfers.put(path, fileTransfer);
}
 
开发者ID:saveendhiman,项目名称:XMPPSample_Studio,代码行数:4,代码来源:LiveApp.java


示例6: getFileTransfer

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
public IncomingFileTransfer getFileTransfer(String path) {
	return fileTransfers.get(path);
}
 
开发者ID:saveendhiman,项目名称:XMPPSample_Studio,代码行数:4,代码来源:LiveApp.java


示例7: FileTransferWorker

import org.jivesoftware.smackx.filetransfer.IncomingFileTransfer; //导入依赖的package包/类
/**
 * Instantiates a new file transfer worker.
 *
 * @param delegate
 *            the delegate
 * @param transfer
 *            the transfer
 */
public FileTransferWorker(FileTransferWorkerDelegate delegate, IncomingFileTransfer transfer)
{
	this.delegate = delegate;
	this.transfer = transfer;
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:14,代码来源:FileTransferWorker.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Link类代码示例发布时间:2022-05-22
下一篇:
Java EAN13Bean类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap