Class ShrinkWrapPath
java.lang.Object
org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapPath
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate final ShrinkWrapFileSystemOwningShrinkWrapFileSystemprivate static final Loggerprivate final StringInternal representation -
Constructor Summary
ConstructorsConstructorDescriptionShrinkWrapPath(String path, ShrinkWrapFileSystem fileSystem) Constructs a new instance using the specified (required) canonical form and backingShrinkWrapFileSystemShrinkWrapPath(ArchivePath path, ShrinkWrapFileSystem fileSystem) Constructs a new instance using the specified (required) path and backingShrinkWrapFileSystem -
Method Summary
Modifier and TypeMethodDescriptionintprivate intcountOccurrences(String string, char c, int offset) Returns the number of occurrences of the specified character in the specifiedString, starting at the specified offsetbooleanbooleanbooleanprivate PathfromString(String path) Creates a newShrinkWrapPathinstance from the specified inputStringgetName(int index) intgetRoot()inthashCode()booleaniterator()private static StringNormalizes 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 ShrinkWrapPathrelativizeCommonRoot(ShrinkWrapPath thisOriginal, Path thisCurrent, Path otherOriginal, Path otherCurrent, int backupCount) Relativizes the paths recursivelyresolveSibling(String other) resolveSibling(Path other) booleanstartsWith(String other) booleanstartsWith(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, waitMethods 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:
getFileSystemin interfacePath- See Also:
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolutein interfacePath- See Also:
-
getRoot
-
getFileName
- Specified by:
getFileNamein interfacePath- See Also:
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCountin 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:
startsWithin interfacePath- See Also:
-
startsWith
- Specified by:
startsWithin interfacePath- See Also:
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath- See Also:
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath- See Also:
-
relativize
- Specified by:
relativizein interfacePath- See Also:
-
toUri
-
toAbsolutePath
Resolves relative paths against the root directory, normalizing as well.- Specified by:
toAbsolutePathin interfacePath- See Also:
-
toRealPath
- Specified by:
toRealPathin interfacePath- Throws:
IOException- See Also:
-
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- See Also:
-
register
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException- See Also:
-
iterator
-
compareTo
- Specified by:
compareToin interfaceComparable<Path>- Specified by:
compareToin interfacePath- See Also:
-
toString
-
fromString
Creates a newShrinkWrapPathinstance 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
-