---
title: 'JNotify: Was tut sich im Dateisystem?'
url: 'https://tutego.de/blog/javainsel/2007/12/jnotify-was-tut-sich-im-dateisystem'
markdown: 'https://tutego.de/blog/javainsel/2007/12/jnotify-was-tut-sich-im-dateisystem.md'
date: '2007-12-01'
description: 'Die kleine (native) unter Linux und Windows arbeitende Bibliothek JNotify meldet Änderungen an Dateien. Ein Beispiel: String path = "c:/";int mask = JNotify.FILE_CREATED | JNotify.FILE_DELETED | JNotify.FILE_MODIFIED | JNotify.FILE_RENAMED;boolean watchSubtree = true;int watchID = JNotify.addWatch(…'
taxonomy:
  category:
    - 'Open Source'
---

# JNotify: Was tut sich im Dateisystem?

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## JNotify: Was tut sich im Dateisystem?

01.12.2007 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

Die kleine (native) unter Linux und Windows arbeitende Bibliothek [JNotify](http://jnotify.sourceforge.net/) meldet Änderungen an Dateien. Ein Beispiel:

```java
String path = "c:/";int mask = JNotify.FILE_CREATED | JNotify.FILE_DELETED | JNotify.FILE_MODIFIED | JNotify.FILE_RENAMED;boolean watchSubtree = true;int watchID = JNotify.addWatch(path, mask, watchSubtree, new JNotifyListener(){@Overridepublic void fileCreated( int arg0, String arg1, String arg2 ){ System.out.println( "created" );}@Overridepublic void fileDeleted( int arg0, String arg1, String arg2 ){ System.out.println( "deleted" );}@Overridepublic void fileModified( int arg0, String arg1, String arg2 ){ System.out.println( "modified" );}@Overridepublic void fileRenamed( int arg0, String arg1, String arg2, String arg3 ){ System.out.println( "renamed" );}} );
```

Und am Ende:

```java
JNotify.removeWatch(watchID);
```

Kategorien: [Open Source](https://tutego.de/blog/javainsel/category/open-source/)

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Next: [JAXB2-Annotationen an Beispielen](https://tutego.de/blog/javainsel/2007/12/jaxb2-annotationen-an-beispielen.md)
