我想在每次修改文件时写一些东西到文件的末尾,我正在使用这段代码:
public class Main {
public static final String DIRECTORY_TO_WATCH = "D:\\test";
public static void main(String[] args) {
Path toWatch = Paths.get(DIRECTORY_TO_WATCH);
if (toWatch == null) {
throw new UnsupportedOperationException();
}
try {
WatchService myWatcher = toWatch.getFileSystem().newWatchService();
FileWatcher fileWatcher = new FileWatcher(myWatcher);
Thread t = new Thread(fileWatcher, "FileWatcher");
t.start();
toWatch.register(myWatcher, StandardWatchEventKinds.ENTRY_MODIFY);
t.join();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
和线程类:
public class …Run Code Online (Sandbox Code Playgroud) 我是新手使用CVS存储库.我正在尝试通过右键单击CVS存储库区域,New - > Repository Location来导入repo,然后弹出一个带有Add CVS存储库的窗口.在连接类型下,在eclipse luna中我有'extssh',但在eclipse mars中我只有'ext'和'pserver'.我需要使用extssh.它是什么以及如何配置它?