/** * 文件上传完毕时,并将其加入到监控map中 * * @param account * @param repoID * @param repoName * @param pathInRepo * @param localPath */ public synchronized void onFileuploaded( Account account, String repoID, String repoName, String pathInRepo, String localPath) { System.out.println("seafile-Monitor:文件上传完毕时,并将其加入到监控map中"); SeafileObserver observer = observers.get(account); if (!observer.watchedFiles.containsKey(localPath)) observer.watchUploadedFile(repoID, repoName, pathInRepo, localPath); }
/** * 从alterationMonitor中删除fileObserver * * @param fileObserver */ private void removeObserver(SeafileObserver fileObserver) { alterationMonitor.removeObserver(fileObserver.getAlterationObserver()); }
/** * 文件下载完毕时,并将其加入到监控map中 * * @param account * @param repoID * @param repoName * @param pathInRepo * @param localPath */ public synchronized void onFileDownloaded( Account account, String repoID, String repoName, String pathInRepo, String localPath) { SeafileObserver observer = observers.get(account); System.out.println("李丹霞当文件下载成功时,加入watch"); observer.watchDownloadedFile(repoID, repoName, pathInRepo, localPath); }
/** * 将fileObserver加入到alterationMonitor中 * * @param fileObserver */ private void addObserver(SeafileObserver fileObserver) { alterationMonitor.addObserver(fileObserver.getAlterationObserver()); }