Class PathSet
java.lang.Object
org.apache.maven.plugins.war.util.PathSet
Set of file's paths.
The class extends functionality of a "normal" set of strings by a process of the paths normalization. All paths are
converted to unix form (slashes) and they don't start with starting /.
- Author:
- Piotr Tabor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNormalizes and adds given path to the set.voidNormalizes and adds given paths to the set.voidNormalizes and adds given paths to the set.voidaddAll(Collection<String> paths) Normalizes and adds given paths (collection of strings) to the set.voidaddAll(Collection<String> paths, String prefix) Normalizes and adds given paths (collection of strings) to the set.voidAdds given paths to the set.voidAdds given paths to the set.voidaddAllFilesInDirectory(File directory, String prefix) Adds to the set all files in the given directoryvoidAdds given prefix to all paths in the set.booleanChecks if the set constains given path.iterator()Returns iterator of normalized paths (strings)paths()intsize()Returns count of the paths in the setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PathSet
public PathSet()Creates an empty paths set -
PathSet
Creates paths set and normalizate and adds all 'paths'. The source 'paths' will not be changed- Parameters:
paths- to be added
-
PathSet
Creates paths set and normalizate and adds all 'paths'. The source 'paths' will not be changed- Parameters:
paths- to be added
-
-
Method Details
-
add
Normalizes and adds given path to the set.- Parameters:
path- to be added
-
addAll
Normalizes and adds given paths (collection of strings) to the set. The source collection will not be changed- Parameters:
paths- - collection of strings to be addedprefix- added to all given paths
-
addAll
Normalizes and adds given paths to the set. The source collection will not be changed- Parameters:
paths- to be addedprefix- added to all given paths
-
addAll
Adds given paths to the set. The source collection will not be changed- Parameters:
paths- to be addedprefix- added to all given paths
-
addAll
Normalizes and adds given paths (collection of strings) to the set. The source collection will not be changed- Parameters:
paths- - collection of strings to be added
-
addAll
Normalizes and adds given paths to the set. The source collection will not be changed- Parameters:
paths- to be added
-
addAll
Adds given paths to the set. The source collection will not be changed- Parameters:
paths- to be added
-
contains
Checks if the set constains given path. The path is normalized before check.- Parameters:
path- we are looking for in the set.- Returns:
- information if the set constains the path.
-
iterator
Returns iterator of normalized paths (strings) -
paths
- Returns:
pathsSet
-
addPrefix
Adds given prefix to all paths in the set. The prefix should be ended by '/'. The generated paths are normalized.- Parameters:
prefix- to be added to all items
-
size
public int size()Returns count of the paths in the set- Returns:
- count of the paths in the set
-
addAllFilesInDirectory
Adds to the set all files in the given directory- Parameters:
directory- that will be searched for file's paths to addprefix- to be added to all found files
-