本文整理汇总了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;未经允许,请勿转载。 |
请发表评论