/** * Copia arquivos
fisicamente * @param inFile Caminho completo
do arquivo de origem * @param outFile Caminho
completo do arquivo de destino * @return true se a cópia
do arquivo for realizada com sucesso */
public boolean copyFile(String inFile, String outFile)
{ InputStream is =
null; OutputStream os =
null; byte[]
buffer; boolean success =
true; try
{ is = new
FileInputStream(inFile); os
= new
FileOutputStream(outFile);
buffer = new
byte[is.available()];
is.read(buffer);
os.write(buffer); } catch (IOException e)
{ success =
false; } catch (OutOfMemoryError e)
{ success =
false; } finally
{ try
{ if (is
!= null)
{
is.close();
} if (os
!= null)
{
os.close();
} } catch (IOException e)
{} } return
success; }
----- Original Message -----
Sent: Wednesday, May 21, 2003 8:41
PM
Subject: RES: [java-list] Copiar
Arquivo
Até
duas:
FileReader e FileWriter permitem copiar
arquivos.
Cristiano
S. Neves Gerente de TI
Prumos Interativa
Ltda. F 55 226 7951 E [EMAIL PROTECTED] U http://www.prumos.com.br
Bom dia
javaneses!
Alguem conhece alguma classe que
me permita copiar um arquivo? To me complicando aqui por causa
diss
Valeu Pessoal!
Marcelo Sousa
Lima
Siemens SBS-SOL
PV
The information contained in this e-mail and in the attached files are for the
exclusive use of the addressee herein nominated, and may contain trade secrets,
privileged and other confidential information,protected by the applicable laws.
In case you are not the right addressee, you are hereby notified that any
reviewing, reading, copying and/or distributing of this e-mail's content is
strictly prohibited and unauthorized. Please, delete the e-mail's content and
notify the sender immediately.
Thank you for your cooperation.
|
|