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 /.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Normalizes and adds given path to the set.void
Normalizes and adds given paths to the set.void
Normalizes and adds given paths to the set.void
addAll
(Collection<String> paths) Normalizes and adds given paths (collection of strings) to the set.void
addAll
(Collection<String> paths, String prefix) Normalizes and adds given paths (collection of strings) to the set.void
Adds given paths to the set.void
Adds given paths to the set.void
addAllFilesInDirectory
(File directory, String prefix) Adds to the set all files in the given directoryvoid
Adds given prefix to all paths in the set.boolean
Checks if the set constains given path.iterator()
Returns iterator of normalized paths (strings)(package private) static String
normalizeSubPath
(String path) paths()
(package private) boolean
Removes the specified path if it exists.int
size()
Returns count of the paths in the setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SEPARATOR
- See Also:
-
SEPARATOR_CHAR
private static final char SEPARATOR_CHAR -
pathsSet
Set of normalized paths
-
-
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
-
normalizeSubPath
-
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.
-
remove
Removes the specified path if it exists.- Parameters:
path
- the path to remove- Returns:
- true if the path was removed, false if it did not existed
-
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
-