KIE NIO.2 :: Model 6.0.0.CR4-Pre1

org.kie.commons.java.nio.base
Class AbstractPath<FS extends FileSystem>

java.lang.Object
  extended by org.kie.commons.java.nio.base.AbstractPath<FS>
All Implemented Interfaces:
Comparable<Path>, Iterable<Path>, AttrHolder, Path, Watchable
Direct Known Subclasses:
GeneralPathImpl

public abstract class AbstractPath<FS extends FileSystem>
extends Object
implements Path, AttrHolder


Nested Class Summary
static class AbstractPath.RootInfo
           
 
Field Summary
protected  AttrsStorage attrsStorage
           
static String DEFAULT_WINDOWS_DRIVER
           
protected  File file
           
protected  FS fs
           
protected  String host
           
protected  boolean isAbsolute
           
protected  boolean isNormalized
           
protected  boolean isRealPath
           
protected  boolean isRoot
           
protected  List<org.kie.commons.data.Pair<Integer,Integer>> offsets
           
protected  byte[] path
           
protected  String toStringFormat
           
protected  boolean usesWindowsFormat
           
static Pattern WINDOWS_DRIVER
           
 
Constructor Summary
protected AbstractPath(FS fs, File file)
           
protected AbstractPath(FS fs, String path, String host, boolean isRoot, boolean isRealPath, boolean isNormalized)
           
 
Method Summary
<V extends AttributeView>
void
addAttrView(V view)
           
 void clearCache()
           
 int compareTo(Path other)
           
protected abstract  String defaultDirectory()
           
 boolean endsWith(Path other)
           
 boolean endsWith(String other)
           
 boolean equals(Object o)
           
 AttrsStorage getAttrStorage()
           
<V extends AttributeView>
V
getAttrView(Class<V> type)
           
<V extends AttributeView>
V
getAttrView(String name)
           
 Path getFileName()
           
 FS getFileSystem()
           
 String getHost()
           
 Path getName(int index)
           
 int getNameCount()
           
 Path getParent()
           
 Path getRoot()
           
 int hashCode()
           
 boolean isAbsolute()
           
 boolean isRealPath()
           
 Iterator<Path> iterator()
           
protected abstract  Path newPath(FS fs, String substring, String host, boolean realPath, boolean isNormalized)
           
protected abstract  Path newRoot(FS fs, String substring, String host, boolean realPath)
           
 Path normalize()
           
 WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events)
           
 WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)
           
 Path relativize(Path otherx)
           
 Path resolve(Path other)
           
 Path resolve(String other)
           
 Path resolveSibling(Path other)
           
 Path resolveSibling(String other)
           
protected abstract  AbstractPath.RootInfo setupRoot(FS fs, String path, String host, boolean isRoot)
           
 boolean startsWith(Path other)
           
 boolean startsWith(String other)
           
 Path subpath(int beginIndex, int endIndex)
           
 Path toAbsolutePath()
           
 Path toRealPath(LinkOption... options)
           
 String toString()
           
 String toString(boolean addHost)
           
 URI toUri()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kie.commons.java.nio.file.Path
toFile
 

Field Detail

WINDOWS_DRIVER

public static final Pattern WINDOWS_DRIVER

DEFAULT_WINDOWS_DRIVER

public static final String DEFAULT_WINDOWS_DRIVER
See Also:
Constant Field Values

fs

protected final FS extends FileSystem fs

usesWindowsFormat

protected final boolean usesWindowsFormat

isAbsolute

protected final boolean isAbsolute

path

protected final byte[] path

isRoot

protected final boolean isRoot

isRealPath

protected final boolean isRealPath

isNormalized

protected final boolean isNormalized

host

protected final String host

toStringFormat

protected String toStringFormat

file

protected File file

offsets

protected final List<org.kie.commons.data.Pair<Integer,Integer>> offsets

attrsStorage

protected final AttrsStorage attrsStorage
Constructor Detail

AbstractPath

protected AbstractPath(FS fs,
                       File file)

AbstractPath

protected AbstractPath(FS fs,
                       String path,
                       String host,
                       boolean isRoot,
                       boolean isRealPath,
                       boolean isNormalized)
Method Detail

newPath

protected abstract Path newPath(FS fs,
                                String substring,
                                String host,
                                boolean realPath,
                                boolean isNormalized)

newRoot

protected abstract Path newRoot(FS fs,
                                String substring,
                                String host,
                                boolean realPath)

setupRoot

protected abstract AbstractPath.RootInfo setupRoot(FS fs,
                                                   String path,
                                                   String host,
                                                   boolean isRoot)

getFileSystem

public FS getFileSystem()
Specified by:
getFileSystem in interface Path

isAbsolute

public boolean isAbsolute()
Specified by:
isAbsolute in interface Path

getRoot

public Path getRoot()
Specified by:
getRoot in interface Path

getFileName

public Path getFileName()
Specified by:
getFileName in interface Path

getParent

public Path getParent()
Specified by:
getParent in interface Path

getNameCount

public int getNameCount()
Specified by:
getNameCount in interface Path

getName

public Path getName(int index)
             throws IllegalArgumentException
Specified by:
getName in interface Path
Throws:
IllegalArgumentException

subpath

public Path subpath(int beginIndex,
                    int endIndex)
             throws IllegalArgumentException
Specified by:
subpath in interface Path
Throws:
IllegalArgumentException

toUri

public URI toUri()
          throws IOException,
                 SecurityException
Specified by:
toUri in interface Path
Throws:
IOException
SecurityException

toAbsolutePath

public Path toAbsolutePath()
                    throws IOException,
                           SecurityException
Specified by:
toAbsolutePath in interface Path
Throws:
IOException
SecurityException

defaultDirectory

protected abstract String defaultDirectory()

toRealPath

public Path toRealPath(LinkOption... options)
                throws IOException,
                       SecurityException
Specified by:
toRealPath in interface Path
Throws:
IOException
SecurityException

iterator

public Iterator<Path> iterator()
Specified by:
iterator in interface Iterable<Path>

startsWith

public boolean startsWith(Path other)
Specified by:
startsWith in interface Path

startsWith

public boolean startsWith(String other)
                   throws InvalidPathException
Specified by:
startsWith in interface Path
Throws:
InvalidPathException

endsWith

public boolean endsWith(Path other)
Specified by:
endsWith in interface Path

endsWith

public boolean endsWith(String other)
                 throws InvalidPathException
Specified by:
endsWith in interface Path
Throws:
InvalidPathException

normalize

public Path normalize()
Specified by:
normalize in interface Path

resolve

public Path resolve(Path other)
Specified by:
resolve in interface Path

resolve

public Path resolve(String other)
             throws InvalidPathException
Specified by:
resolve in interface Path
Throws:
InvalidPathException

resolveSibling

public Path resolveSibling(Path other)
Specified by:
resolveSibling in interface Path

resolveSibling

public Path resolveSibling(String other)
                    throws InvalidPathException
Specified by:
resolveSibling in interface Path
Throws:
InvalidPathException

relativize

public Path relativize(Path otherx)
                throws IllegalArgumentException
Specified by:
relativize in interface Path
Throws:
IllegalArgumentException

compareTo

public int compareTo(Path other)
Specified by:
compareTo in interface Comparable<Path>

register

public WatchKey register(WatchService watcher,
                         WatchEvent.Kind<?>[] events,
                         WatchEvent.Modifier... modifiers)
                  throws UnsupportedOperationException,
                         IllegalArgumentException,
                         ClosedWatchServiceException,
                         IOException,
                         SecurityException
Specified by:
register in interface Watchable
Throws:
UnsupportedOperationException
IllegalArgumentException
ClosedWatchServiceException
IOException
SecurityException

register

public WatchKey register(WatchService watcher,
                         WatchEvent.Kind<?>... events)
                  throws UnsupportedOperationException,
                         IllegalArgumentException,
                         ClosedWatchServiceException,
                         IOException,
                         SecurityException
Specified by:
register in interface Watchable
Throws:
UnsupportedOperationException
IllegalArgumentException
ClosedWatchServiceException
IOException
SecurityException

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean addHost)

clearCache

public void clearCache()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getHost

public String getHost()

isRealPath

public boolean isRealPath()

getAttrStorage

public AttrsStorage getAttrStorage()
Specified by:
getAttrStorage in interface AttrHolder

addAttrView

public <V extends AttributeView> void addAttrView(V view)
Specified by:
addAttrView in interface AttrHolder

getAttrView

public <V extends AttributeView> V getAttrView(Class<V> type)
Specified by:
getAttrView in interface AttrHolder

getAttrView

public <V extends AttributeView> V getAttrView(String name)
Specified by:
getAttrView in interface AttrHolder

KIE NIO.2 :: Model 6.0.0.CR4-Pre1

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.