Package org.apache.groovy.nio.runtime
Class WritablePath
java.lang.Object
org.apache.groovy.nio.runtime.WritablePath
A Writable Path.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanbooleanbooleangetName(int index) intgetRoot()inthashCode()booleaniterator()register(WatchService watcher, WatchEvent.Kind<?>... events) register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize(Path other) resolveSibling(String other) resolveSibling(Path other) booleanstartsWith(String other) booleanstartsWith(Path other) subpath(int beginIndex, int endIndex) toFile()toRealPath(LinkOption... options) toString()toUri()Writes this object to the given writer.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
WritablePath
-
WritablePath
-
-
Method Details
-
writeTo
Description copied from interface:WritableWrites this object to the given writer.This is used to defer content creation until the point when it is streamed to the output destination. Oftentimes, content will be defined but not necessarily created (as it may be the case with a Closure definition.) In that case, the output is then 'deferred' to the point when it is serialized to the writer. This class may be used whenever an object should be responsible for creating its own textual representation, but creating the entire output as a single String would be inefficient (such as outputting a multi-gigabyte XML document.)
- Specified by:
writeToin interfaceWritable- Parameters:
out- the Writer to which this Writable should output its data.- Returns:
- the Writer that was passed
- Throws:
IOException- if an error occurred while outputting data to the writer
-
getFileSystem
- Specified by:
getFileSystemin interfacePath
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolutein interfacePath
-
getRoot
-
getFileName
- Specified by:
getFileNamein interfacePath
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCountin interfacePath
-
getName
-
subpath
-
startsWith
- Specified by:
startsWithin interfacePath
-
startsWith
- Specified by:
startsWithin interfacePath
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath
-
relativize
- Specified by:
relativizein interfacePath
-
toUri
-
toAbsolutePath
- Specified by:
toAbsolutePathin interfacePath
-
toRealPath
- Specified by:
toRealPathin interfacePath- Throws:
IOException
-
toFile
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException - Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
register
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
iterator
-
compareTo
- Specified by:
compareToin interfaceComparable<Path>- Specified by:
compareToin interfacePath
-
equals
-
hashCode
public int hashCode() -
toString
-