java - Java7 WatchService: Is there a "built-in" way to Ignore OS-specific files like .DS_Store? -


so, know it's possible "the manual way" ignore such files.

at moment, like:

path filename = ev.context();  if(filename.equals(".ds_store")){   break; //the event loop } 

but seems little hacky me (ok, create enum string, create method checks , on, still, in context of os-specific generated files hoped find "built-in" handle me.), i'm asking if there's kind of built-in way in java7 watchservice haven't discovered yet ignore such files.

p.s: use-case it's (sadly) not option other way round, "ignore files except pattern". has "allow files except few ones".

i don't believe java supports os-specific file name check. however, seems fine check hidden files, prefer more general starts '.'

if (filename.charat(0) == '.') {   continue; // skip hidden files. break wrong, i'd continue. } 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -