Package org.apache.groovy.nio.runtime
Class WritablePath
java.lang.Object
org.apache.groovy.nio.runtime.WritablePath
A Writable Path.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
boolean
getName
(int index) int
getRoot()
int
hashCode()
boolean
iterator()
register
(WatchService watcher, WatchEvent.Kind<?>... events) register
(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize
(Path other) resolveSibling
(String other) resolveSibling
(Path other) boolean
startsWith
(String other) boolean
startsWith
(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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
WritablePath
-
WritablePath
-
-
Method Details
-
writeTo
Description copied from interface:Writable
Writes 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 is 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:
writeTo
in 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:
getFileSystem
in interfacePath
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolute
in interfacePath
-
getRoot
-
getFileName
- Specified by:
getFileName
in interfacePath
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCount
in interfacePath
-
getName
-
subpath
-
startsWith
- Specified by:
startsWith
in interfacePath
-
startsWith
- Specified by:
startsWith
in interfacePath
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
-
relativize
- Specified by:
relativize
in interfacePath
-
toUri
-
toAbsolutePath
- Specified by:
toAbsolutePath
in interfacePath
-
toRealPath
- Specified by:
toRealPath
in interfacePath
- Throws:
IOException
-
toFile
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException - Specified by:
register
in interfacePath
- Specified by:
register
in interfaceWatchable
- Throws:
IOException
-
register
- Specified by:
register
in interfacePath
- Specified by:
register
in interfaceWatchable
- Throws:
IOException
-
iterator
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Path>
- Specified by:
compareTo
in interfacePath
-
equals
-
hashCode
public int hashCode() -
toString
-