2012-07-24 4 views
0

한 디렉터리에서 다른 디렉터리로 이미지를 복사하는 기능을 Java로 작성했습니다. IOException, 즉 C:\Documents and Settings\Admin\Desktop\C.V (Access is denied)을 던집니다. 무엇이 문제 일 수 있습니다.한 디렉터리에서 다른 디렉터리로 이미지를 복사하는 방법

public void copyImageFiles(File sourceFile, File destinationDir) throws IOException { 

    FileInputStream fis = new FileInputStream(sourceFile); 
    FileOutputStream fos = new FileOutputStream(destinationDir); 
    FileChannel srcChannel = fis.getChannel(); 
    FileChannel destChannel = fos.getChannel(); 
    srcChannel.transferTo(0, sourceFile.length(), destChannel); 
    srcChannel.close(); 
    destChannel.close(); 
    fis.close(); 
    fos.close();  
} 

답변

0

C:\Documents and Settings\Admin\Desktop\C.V (Access is denied)

그것은 W7 수 또는 Vista 또는 W7 +해야합니다 여기에 코드 예제이다. 프로그램에 쓰기 권한이 없습니다 C:\Documents and Settings\Admin

다른 드라이브와 같이 다른 곳으로 대상을 변경하십시오. 또는 관리자 권한으로 프로그램을 실행하십시오.

은 참조 :

http://think-like-a-computer.com/2011/05/11/windows-access-denied-folder-administrator/

ICACLS http://technet.microsoft.com/en-us/library/cc753525%28v=ws.10%29.aspx

0

당신이 관리자로 로그인 했습니까? 계정에 필요한 권한이없는 경우 관리 폴더에 액세스하면 예외가 발생합니다.

0
C:\Documents and Settings\Admin\Desktop\C.V (Access is denied) 

사용 권한 문제입니다. 폴더의 속성을 확인해보십시오.

0

관리자로 로그인하지 않았습니다. 제어판에서 사용자에게 가서 관리자 권한을 확인하십시오.

관련 문제