public class PathPair extends Object
The PathPair is used for the windows watcher implementation. In ntfs the
watched directories are locked so deleting them is impossible. The windows
watcher watches one directory down ( at the expense of getting many more
events) and this class holds the mapping between the target
directory (the one we intend to listen events) vs the actually
watched directory.
This workaround, does not completely eliminate the locking problem. For example, when working with maven projects one first needs to clean and then build (two commands). In eclipse, sometimes the m2e plugin complains that it can not access generated files. This is usually fixed with a clean.
| Constructor and Description |
|---|
PathPair(Path target)
Instantiates a new path pair.
|
PathPair(Path target,
Path watched)
Instantiates a new path pair.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static PathPair |
get(Path target)
Factory method for creating target-target path pair
|
static PathPair |
get(Path target,
Path watched)
Factory method for creating a target-watched path pair
|
String |
getShortDescription() |
Path |
getTarget()
Gets the target path
|
Path |
getWatched()
Gets the watched path.
|
int |
hashCode() |
boolean |
isWatching(Path target)
Checks if the parameter path is being watched.
|
Path |
resolve(Path other)
Resolve a relative path (as returned by the java watcher) to an absolute path
|
String |
toString() |
public PathPair(Path target)
target - the targetpublic static PathPair get(Path target)
target - public static PathPair get(Path target, Path watched)
target - the target pathwatched - the watched pathpublic Path getWatched()
public Path getTarget()
public Path resolve(Path other)
other - the otherpublic boolean isWatching(Path target)
target - the targetpublic String getShortDescription()
Copyright © 2018. All rights reserved.