을 던지고있다 editor.addFile(textfile, null, -1);
는 저장소와 아래의 코드는 java.lang.NullPointerException이
try {
url = "https://XXX.yyy.zzzz";
SVNRepository repository = null;
String name = "testuser";
String password = "testuserpassword";
repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password);
repository.setAuthenticationManager(authManager);
System.out.println(repository.getLatestRevision());
SVNClientInterface client = SVNClientImpl.newInstance();
} catch (Exception e) {
System.out.println("error");
}
try {
ISVNEditor editor = repository.getCommitEditor("This is a log message.", new CommitMediator());
editor.openRoot(-1);
System.out.println("in DAV");
editor.addFile(textfile, null, -1);
editor.addFile("file1.txt", null, -1);
editor.applyTextDelta("file1.txt", null);
OutputStream os=null;
os.close();
editor.textDeltaEnd(file1.txt);
editor.closeFile(file1.txt, null);
editor.closeEdit();
} catch(Exception e) {
System.out.println(e);
}
편집기를 사용하여 저장소에 파일을 추가 할 수 없으며 "editor.addFile (textfile, null, -1); 줄의 java.lang.NullPointerException 예외가 발생합니다."감사의 전한 – user1118693
'os. close();'OutputStream os = null; 다음에'NullPointerException'을 의미합니다. – javanna
log4j 또는 로깅을 사용하지 않으려면 적어도'System.out.println (e);'를'e.printStackTrace();'로 바꾸십시오! – javanna