Package org.apache.groovy.nio.runtime
Class WritablePath
java.lang.Object
org.apache.groovy.nio.runtime.WritablePath
- All Implemented Interfaces:
Writable
,java.lang.Comparable<java.nio.file.Path>
,java.lang.Iterable<java.nio.file.Path>
,java.nio.file.Path
,java.nio.file.Watchable
public class WritablePath extends java.lang.Object implements java.nio.file.Path, Writable
A Writable Path.
-
Constructor Summary
Constructors Constructor Description WritablePath(java.nio.file.Path delegate)
WritablePath(java.nio.file.Path delegate, java.lang.String encoding)
-
Method Summary
Modifier and Type Method Description int
compareTo(java.nio.file.Path other)
boolean
endsWith(java.lang.String other)
boolean
endsWith(java.nio.file.Path other)
boolean
equals(java.lang.Object other)
java.nio.file.Path
getFileName()
java.nio.file.FileSystem
getFileSystem()
java.nio.file.Path
getName(int index)
int
getNameCount()
java.nio.file.Path
getParent()
java.nio.file.Path
getRoot()
int
hashCode()
boolean
isAbsolute()
java.util.Iterator<java.nio.file.Path>
iterator()
java.nio.file.Path
normalize()
java.nio.file.WatchKey
register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events)
java.nio.file.WatchKey
register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers)
java.nio.file.Path
relativize(java.nio.file.Path other)
java.nio.file.Path
resolve(java.lang.String other)
java.nio.file.Path
resolve(java.nio.file.Path other)
java.nio.file.Path
resolveSibling(java.lang.String other)
java.nio.file.Path
resolveSibling(java.nio.file.Path other)
boolean
startsWith(java.lang.String other)
boolean
startsWith(java.nio.file.Path other)
java.nio.file.Path
subpath(int beginIndex, int endIndex)
java.nio.file.Path
toAbsolutePath()
java.io.File
toFile()
java.nio.file.Path
toRealPath(java.nio.file.LinkOption... options)
java.lang.String
toString()
java.net.URI
toUri()
java.io.Writer
writeTo(java.io.Writer out)
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
public WritablePath(java.nio.file.Path delegate) -
WritablePath
public WritablePath(java.nio.file.Path delegate, java.lang.String encoding)
-
-
Method Details
-
writeTo
public java.io.Writer writeTo(java.io.Writer out) throws java.io.IOExceptionDescription 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.)
-
getFileSystem
public java.nio.file.FileSystem getFileSystem()- Specified by:
getFileSystem
in interfacejava.nio.file.Path
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolute
in interfacejava.nio.file.Path
-
getRoot
public java.nio.file.Path getRoot()- Specified by:
getRoot
in interfacejava.nio.file.Path
-
getFileName
public java.nio.file.Path getFileName()- Specified by:
getFileName
in interfacejava.nio.file.Path
-
getParent
public java.nio.file.Path getParent()- Specified by:
getParent
in interfacejava.nio.file.Path
-
getNameCount
public int getNameCount()- Specified by:
getNameCount
in interfacejava.nio.file.Path
-
getName
public java.nio.file.Path getName(int index)- Specified by:
getName
in interfacejava.nio.file.Path
-
subpath
public java.nio.file.Path subpath(int beginIndex, int endIndex)- Specified by:
subpath
in interfacejava.nio.file.Path
-
startsWith
public boolean startsWith(java.nio.file.Path other)- Specified by:
startsWith
in interfacejava.nio.file.Path
-
startsWith
public boolean startsWith(java.lang.String other)- Specified by:
startsWith
in interfacejava.nio.file.Path
-
endsWith
public boolean endsWith(java.nio.file.Path other)- Specified by:
endsWith
in interfacejava.nio.file.Path
-
endsWith
public boolean endsWith(java.lang.String other)- Specified by:
endsWith
in interfacejava.nio.file.Path
-
normalize
public java.nio.file.Path normalize()- Specified by:
normalize
in interfacejava.nio.file.Path
-
resolve
public java.nio.file.Path resolve(java.nio.file.Path other)- Specified by:
resolve
in interfacejava.nio.file.Path
-
resolve
public java.nio.file.Path resolve(java.lang.String other)- Specified by:
resolve
in interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.nio.file.Path other)- Specified by:
resolveSibling
in interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.lang.String other)- Specified by:
resolveSibling
in interfacejava.nio.file.Path
-
relativize
public java.nio.file.Path relativize(java.nio.file.Path other)- Specified by:
relativize
in interfacejava.nio.file.Path
-
toUri
public java.net.URI toUri()- Specified by:
toUri
in interfacejava.nio.file.Path
-
toAbsolutePath
public java.nio.file.Path toAbsolutePath()- Specified by:
toAbsolutePath
in interfacejava.nio.file.Path
-
toRealPath
public java.nio.file.Path toRealPath(java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
toRealPath
in interfacejava.nio.file.Path
- Throws:
java.io.IOException
-
toFile
public java.io.File toFile()- Specified by:
toFile
in interfacejava.nio.file.Path
-
register
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers) throws java.io.IOException- Specified by:
register
in interfacejava.nio.file.Path
- Specified by:
register
in interfacejava.nio.file.Watchable
- Throws:
java.io.IOException
-
register
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events) throws java.io.IOException- Specified by:
register
in interfacejava.nio.file.Path
- Specified by:
register
in interfacejava.nio.file.Watchable
- Throws:
java.io.IOException
-
iterator
public java.util.Iterator<java.nio.file.Path> iterator()- Specified by:
iterator
in interfacejava.lang.Iterable<java.nio.file.Path>
- Specified by:
iterator
in interfacejava.nio.file.Path
-
compareTo
public int compareTo(java.nio.file.Path other)- Specified by:
compareTo
in interfacejava.lang.Comparable<java.nio.file.Path>
- Specified by:
compareTo
in interfacejava.nio.file.Path
-
equals
public boolean equals(java.lang.Object other)- Specified by:
equals
in interfacejava.nio.file.Path
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacejava.nio.file.Path
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Specified by:
toString
in interfacejava.nio.file.Path
- Overrides:
toString
in classjava.lang.Object
-