Fehlermeldung beim kopieren Verzeichnis in java

brusli

Grünschnabel
ich habe folgendes Fehlermeldung während Kopieren von Verzeichnis :
Fehlermeldung : java.io.FileNotFoundException : c:\Programme\Gemeinsame Dateien\Symantec Shared\CCPD-LC\symlcrst.dll (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird). Hat jemand Idee wie man das beseitigen kann.
Code:
import java.io.*;
  
public class FileCopy
{
 public static void main(String[] args)
 {  
  try
  {
   copyFiles("C:\\Programme", "C:\\bb");
  }
  catch (IOException e)
  {
   System.err.println(e);
  }
 }
 
 
 public static void copyFiles(String strPath, String dstPath) throws IOException
 {
 File src = new File(strPath);
 File dest = new File(dstPath);
 
 if (src.isDirectory())
 {
  dest.mkdirs();
  String list[] = src.list();  
  for (int i = 0; i < list.length; i++)
  {
   String dest1 = dest.getAbsolutePath() + File.separator + list[i];
   String src1 = src.getAbsolutePath() + File.separator + list[i];
   copyFiles(src1 , dest1);
  }
 }
 else
 {
  int puffergrosse = 1024;
  byte[] puffer = new byte[puffergrosse];
  FileInputStream fin = new FileInputStream(src);
  FileOutputStream fout = new FileOutputStream (dest);
  int c;
  while ((c = fin.read(puffer,0,puffergrosse)) >= 0)
  {
   fout.write(puffer,0,c);
  }
    fin.close();
    fout.close();
  }
 }
}
 
Zurück