Class ShrinkWrapPath
java.lang.Object
org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapPath
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private final ShrinkWrapFileSystem
OwningShrinkWrapFileSystem
private static final Logger
private final String
Internal representation -
Constructor Summary
ConstructorsConstructorDescriptionShrinkWrapPath
(String path, ShrinkWrapFileSystem fileSystem) Constructs a new instance using the specified (required) canonical form and backingShrinkWrapFileSystem
ShrinkWrapPath
(ArchivePath path, ShrinkWrapFileSystem fileSystem) Constructs a new instance using the specified (required) path and backingShrinkWrapFileSystem
-
Method Summary
Modifier and TypeMethodDescriptionint
private int
countOccurrences
(String string, char c, int offset) Returns the number of occurrences of the specified character in the specifiedString
, starting at the specified offsetboolean
boolean
boolean
private Path
fromString
(String path) Creates a newShrinkWrapPath
instance from the specified inputString
getName
(int index) int
getRoot()
int
hashCode()
boolean
iterator()
private static String
Normalizes the tokenized view of the pathregister
(WatchService watcher, WatchEvent.Kind<?>... events) register
(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize
(Path other) private static ShrinkWrapPath
relativizeCommonRoot
(ShrinkWrapPath thisOriginal, Path thisCurrent, Path otherOriginal, Path otherCurrent, int backupCount) Relativizes the paths recursivelyresolveSibling
(String other) resolveSibling
(Path other) boolean
startsWith
(String other) boolean
startsWith
(Path other) subpath
(int beginIndex, int endIndex) Resolves relative paths against the root directory, normalizing as well.toFile()
tokenize
(ShrinkWrapPath path) Returns the components of this path in order from root outtoRealPath
(LinkOption... options) toString()
toUri()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
log
-
DIR_BACK
- See Also:
-
DIR_THIS
- See Also:
-
path
Internal representation -
fileSystem
OwningShrinkWrapFileSystem
-
-
Constructor Details
-
ShrinkWrapPath
ShrinkWrapPath(String path, ShrinkWrapFileSystem fileSystem) throws IllegalArgumentException Constructs a new instance using the specified (required) canonical form and backingShrinkWrapFileSystem
- Parameters:
path
-fileSystem
-- Throws:
IllegalArgumentException
- If the path or file system is not specified
-
ShrinkWrapPath
ShrinkWrapPath(ArchivePath path, ShrinkWrapFileSystem fileSystem) throws IllegalArgumentException Constructs a new instance using the specified (required) path and backingShrinkWrapFileSystem
- Parameters:
path
- to be evaluated usingArchivePath.get()
fileSystem
-- Throws:
IllegalArgumentException
- If the path or file system is not specifiedIllegalArgumentException
- If the delegate is not specified
-
-
Method Details
-
getFileSystem
- Specified by:
getFileSystem
in interfacePath
- See Also:
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolute
in interfacePath
- See Also:
-
getRoot
-
getFileName
- Specified by:
getFileName
in interfacePath
- See Also:
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCount
in interfacePath
- See Also:
-
countOccurrences
Returns the number of occurrences of the specified character in the specifiedString
, starting at the specified offset- Parameters:
string
-c
-offset
-- Returns:
-
getName
-
subpath
-
startsWith
- Specified by:
startsWith
in interfacePath
- See Also:
-
startsWith
- Specified by:
startsWith
in interfacePath
- See Also:
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
- See Also:
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
- See Also:
-
relativize
- Specified by:
relativize
in interfacePath
- See Also:
-
toUri
-
toAbsolutePath
Resolves relative paths against the root directory, normalizing as well.- Specified by:
toAbsolutePath
in interfacePath
- See Also:
-
toRealPath
- Specified by:
toRealPath
in interfacePath
- Throws:
IOException
- See Also:
-
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
- See Also:
-
register
- Specified by:
register
in interfacePath
- Specified by:
register
in interfaceWatchable
- Throws:
IOException
- See Also:
-
iterator
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Path>
- Specified by:
compareTo
in interfacePath
- See Also:
-
toString
-
fromString
Creates a newShrinkWrapPath
instance from the specified inputString
- Parameters:
path
-- Returns:
-
tokenize
Returns the components of this path in order from root out- Returns:
-
normalize
Normalizes the tokenized view of the path- Parameters:
path
-- Returns:
-
relativizeCommonRoot
private static ShrinkWrapPath relativizeCommonRoot(ShrinkWrapPath thisOriginal, Path thisCurrent, Path otherOriginal, Path otherCurrent, int backupCount) Relativizes the paths recursively- Parameters:
thisOriginal
-thisCurrent
-otherOriginal
-otherCurrent
-backupCount
-- Returns:
-
hashCode
public int hashCode() -
equals
-