Cancelar uma transferência?

Fala galera, gostaria de saber como faço pra cancelar uma transferência utilizando o código abaixo pra enviar o arquivo???

public void sendFile()
    {   
        try
        {
            while(ite.hasNext())
            {  
            	int blockSend = 0;
	            //long tamanhoTotal = 0;
	            File file = (File) ite.next();
	            //tamanhoTotal += ite.length();
	            fileUpload = "/"+file.getName()+"/";
	            output = filePath + fileUpload;
	            InputStream in = new FileInputStream(file);
	            OutputStream out = new FileOutputStream(output);          
	            bytesUploaded = 0;
	            byte[] buffer = new byte[100000];
	            int percVal = 0;
	                
	            //log.append("Tamanho Total: " + tamanhoTotal + newline);
	            log.append("Enviando: " + file.getName() + newline);
	                                
	            while((tamanho = in.read(buffer)) >= 0)
	            {
	            	bytesUploaded += tamanho;
	                percVal = (int) ((bytesUploaded / fileSize) * 100);
	                currentFileUpPercent = percVal;
	                barra.setValue(currentFileUpPercent);
	                out.write(buffer, 0, tamanho);
	            }
	                                
	            in.close(); 
	            out.close();
	            log.append("Arquivo enviado com sucesso: " + file.getName() + newline + newline);                   
	            barra.setValue(0);
            }
        }

        catch(Exception e)
        {
            log.append("Erro ao enviar o arquivo: " + newline + e.getMessage());
            log.invalidate();
        }
    }

Fiz alguns teste, porém até agora sem sucesso, será que alguém tem uma sugestão???

Abraços