2016-11-20 1 views

답변

2

당신이

File dir = new File("my directory"); 
dir.mkdir(); 

// Make it not readable, writable and executable for anyone 
dir.setExecutable(false, false); 
dir.setReadable(false, false); 
dir.setWritable(false, false); 

// Make it readable, writable and executable for the owner only (see 
// second parameter "ownerOnly" to these calls) 
dir.setExecutable(true, true); 
dir.setReadable(true, true); 
dir.setWritable(true, true); 

자바 NIO API의 File 개체의 방법을 사용할 수 있습니다 더있다 같은

+0

나는 다음과 같은 코드를 실행 한 후 폴더에 액세스 할 수 있기 때문에, 동일한 작업을 수행하는 컨트롤을 세밀한. 'dir.setExecutable (false, false); dir.setReadable (false, false); dir.setWritable (false, false); ' –

관련 문제