|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectname.pachler.nio.file.Path
name.pachler.nio.file.impl.PathImpl
public class PathImpl
This is a minimal implementation of JDK7's Path class, so all we offer here is what is required for WatchService and friends to work
| Constructor Summary | |
|---|---|
PathImpl(java.io.File file)
This constructor does not comply with JDK7. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.io.File |
getFile()
This method does not exist in JDK7 and is only supplied for convenience |
int |
hashCode()
|
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>... events)
Registers the file system path (a directory) with the given WatchService and provides a WatchKey as a handle for that registration. |
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>[] events,
WatchEvent.Modifier... modifiers)
Registers the file system path (a directory) with the given WatchServiceand provides a WatchKey as a handle for that registration. |
Path |
resolve(Path other)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PathImpl(java.io.File file)
filere - | Method Detail |
|---|
public Path resolve(Path other)
resolve in class Path
public WatchKey register(WatchService watcher,
WatchEvent.Kind<?>... events)
throws java.io.IOException
Watchableregister(watcher, events, new WatchEvent.Modifier[0]);
register in interface Watchableregister in class Pathjava.io.IOExceptionPath.register(name.pachler.nio.file.WatchService, name.pachler.nio.file.WatchEvent.Kind>[], name.pachler.nio.file.WatchEvent.Modifier[])
public WatchKey register(WatchService watcher,
WatchEvent.Kind<?>[] events,
WatchEvent.Modifier... modifiers)
throws java.io.IOException
WatchableWatchServiceand provides a WatchKey as a handle for that registration.
The events and modifier lists determine the events that the
WatchService will report.WatchService, the same WatchKey will be returned. In this case,
the WatchKey's watch settings are altered to match the new event
and modifier lists. Note that such changes may result in
StandardWatchEventKind.OVERFLOW events to be reported on some platforms.StandardWatchEventKind, ExtendedWatchEventKind and
ExtendedWatchEventModifier may be supported on a target platform
(typically though, in this implementation, all event kinds defined in
StandardWatchEventKind are always supported).
register in interface Watchableregister in class Pathwatcher - a valid WatchService instance.events - The events to register for. The event kinds defined in
StandardWatchEventKindand ExtendedWatchEventKind
define valid event kinds that can
be passed in here. Not that not all event kinds may be supported on
a given platform, so see the documentation of a specific event kind.modifiers - The event modifiers to use when registering. WatchEvent.Modifiers
define special behaviour that's expected from the WatchService. Note
that some event modifiers may not be supported on a given platform;
see the specific modifier for details.
WatchKey that represents the registration.
java.io.IOException - for general I/O errorsStandardWatchEventKind,
ExtendedWatchEventKind,
ExtendedWatchEventModifierpublic java.io.File getFile()
public java.lang.String toString()
toString in class Pathpublic boolean equals(java.lang.Object obj)
equals in class Pathpublic int hashCode()
hashCode in class Path
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||