Copiar aquivos em java

3 respostas
C

como q faco pra copiar aquivos .mbd d um diretorio pra outro usando Java ?
Alquem ja fez isso alguma vez ?

3 Respostas

R

Só tranferir arquivo? É fácil…

FileInputStream fis = new FileInputStream("arqOrigem");
FileOutputStream for = new FileOutputStream("arqDestino");
FileChannel fcOrg = fis.getChannel();
FileChannel fcDest = fos.getChannel();
fc.transferTo(fcDest);

Teste aí o programa e veja se funciona

C

“microfilo”:
Só tranferir arquivo? É fácil…

FileInputStream fis = new FileInputStream("arqOrigem");
FileOutputStream for = new FileOutputStream("arqDestino");
FileChannel fcOrg = fis.getChannel();
FileChannel fcDest = fos.getChannel();
fc.transferTo(fcDest);

Teste aí o programa e veja se funciona

nao funcionou!
fcOrg.transferTo(fcDest);

deu pau aqui!

M

E ae cassolato! Blz?

Cara tem um exemplo neste topico

http://www.portaljava.com.br/home/modules.php?name=Forums&file=viewtopic&t=12361&highlight=&sid=0bc365484822043c89de93faece0ddf5

ps.: Conseguiu arrumar aquele erro do jasper?

Falow!!! :grin:

Criado 24 de junho de 2005
Ultima resposta 27 de jun. de 2005
Respostas 3
Participantes 3