Apache VFS(4): 事件

來源:互聯網
上載者:User
本系列文章導航

Apache VFS(1): 基本介紹

Apache VFS(2): 檔案的監聽和監控

Apache VFS(3): 檔案過濾器和選取器

Apache VFS(4): 事件

Apache VFS(5): 使用它!

Apache VFS(6): 幾個重要的概念性介面

Apache VFS(7): 檔案管理工具解析檔案的方法

 Apache VFS的事件只有檔案改變事件,這個事件模型比較特別:

org.apache.commons.vfs.FileChangeEvent類

是頂層,也是具體類,只有一個方法:getFile(),返回觸發事件的檔案對象。

org.apache.commons.vfs.events.AbstractFileChangeEvent抽象類別

繼承了上述的FileChangeEvent具體類,增加了一個抽象方法:notify(FileListener listener)

來通知監聽器

我們真正使用的有三個繼承上述抽象類別的具體類:

  1. ChangedEvent
  2. CreatedEvent
  3. DeletedEvent

他們分別實現了上述抽象方法

 

文章來源:http://alartin.javaeye.com/blog/92318

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.