• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Apache Common VFS

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am trying to set up a test case for monitoring files using Apache Commons VFS. Basically I would like to do some work if the monitored file is created, deleted, changed causing a FileChangeEvent.

Here is the test code. I changed the files at both locations. It works for HTTP but not for FTP. Any help would be appreciated.

Files were located and results from showProperties:
URL: ftp://myusername:mypassword@somehost/test.txt
getName(): ftp://myusername:mypassword@somehost/test.txt
BaseName: test.txt
Extension: txt
Path: /test.txt
Scheme: ftp
URI: ftp://myusername:mypassword@somehost/test.txt
Root URI: ftp://myusername:mypassword@somehost/
Parent: ftp://myusername:mypassword@somehost/
Type: file
Exists: true
Readable: true
Writeable: true
Root path: /
Size: 41 bytes
Last modified: 2/21/12 10:00 PM

URL: http://somehost/test/test123.txt
getName(): http://somehost/test/test123.txt
BaseName: test123.txt
Extension: txt
Path: /test/test123.txt
Scheme: http
URI: http://somehost/test/test123.txt
Root URI: http://somehost/
Parent: http://somehost/test
Type: file
Exists: true
Readable: true
Writeable: true
Root path: /
Size: 1237 bytes
Last modified: 2/17/12 9:29 AM

Changing the HTTP File created the FileChangeEvent. FTP did not.
File [http://somehost/test/test123.txt] changed event from [org.pdc.apps.vfs.FileMonitorTest$MyFileListener@56d90453]
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic