Bom dia pessoa,
Estou com seguinte problema.
Estou tentando copiar um arquivo de uma pasta pra outra e estou recebendo uma mensagem de (Acesso negado)
Já fiz as verficação de permissões de pastas e está tudo ok.
Segue meu código abaixo.
String inFile = "C:\___temp\Arquivo.txt";
String outFile = "\\sbr001001-009\Automovel\TECNICA\Usuarios\Fernanda\varreduras\";
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;
System.out.println("Saindo po IO");
System.out.println(e.getMessage());
}
catch (OutOfMemoryError e)
{
success = false;
System.out.println("Saindo po OutofMemory");
}
finally
{
try
{
if (is != null)
{
is.close();
}
if (os != null)
{
os.close();
}
}
catch (IOException e)
{
}
}
Já tentei copiar assim também
String inFile = "C:\___temp\Arquivo.txt";
String outFile = "C:\___temp\copia\Arquivo.txt";
Mas tá me retornando:
C:\___temp\copia (Acesso negado)
Alguém tem uma dica de como resolver isso.
Dei uma pesquisada e li a respeito de “assinatura”, mas não entendi muito bem .
Grato à todos.
Fabio Nascimento