public class PathSet
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.String> |
pathsSet
Set of normalized paths
|
| Constructor and Description |
|---|
PathSet()
Creates an empty paths set
|
PathSet(java.util.Collection<java.lang.String> paths)
Creates paths set and normalizate and adds all 'paths'.
|
PathSet(java.lang.String[] paths)
Creates paths set and normalizate and adds all 'paths'.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String path)
Normalizes and adds given path to the set.
|
void |
addAll(java.util.Collection<java.lang.String> paths)
Normalizes and adds given paths (collection of strings) to the set.
|
void |
addAll(java.util.Collection<java.lang.String> paths,
java.lang.String prefix)
Normalizes and adds given paths (collection of strings) to the set.
|
void |
addAll(PathSet paths)
Adds given paths to the set.
|
void |
addAll(PathSet paths,
java.lang.String prefix)
Adds given paths to the set.
|
void |
addAll(java.lang.String[] paths)
Normalizes and adds given paths to the set.
|
void |
addAll(java.lang.String[] paths,
java.lang.String prefix)
Normalizes and adds given paths to the set.
|
void |
addAllFilesInDirectory(java.io.File directory,
java.lang.String prefix)
Adds to the set all files in the given directory
|
void |
addPrefix(java.lang.String prefix)
Adds given prefix to all paths in the set.
|
boolean |
contains(java.lang.String path)
Checks if the set constains given path.
|
java.util.Iterator<java.lang.String> |
iterator()
Returns iterator of normalized paths (strings)
|
protected java.lang.String |
normalizeFilePath(java.lang.String path)
The method normalizes the path.
|
static java.lang.String |
normalizeFilePathStatic(java.lang.String path)
The method normalizes the path.
|
java.util.Collection<java.lang.String> |
paths() |
(package private) boolean |
remove(java.lang.String path)
Removes the specified path if it exists.
|
int |
size()
Returns count of the paths in the set
|
static java.lang.String |
trimTrailingSlashes(java.lang.String str)
The method deletes all trailing slashes from the given string
|
public PathSet()
public PathSet(java.util.Collection<java.lang.String> paths)
paths - to be addedpublic PathSet(java.lang.String[] paths)
paths - to be addedprotected java.lang.String normalizeFilePath(java.lang.String path)
path - to normalizationpublic void add(java.lang.String path)
path - to be addedpublic void addAll(java.util.Collection<java.lang.String> paths,
java.lang.String prefix)
paths - - collection of strings to be addedprefix - added to all given pathspublic void addAll(java.lang.String[] paths,
java.lang.String prefix)
paths - to be addedprefix - added to all given pathspublic void addAll(PathSet paths, java.lang.String prefix)
paths - to be addedprefix - added to all given pathspublic void addAll(java.util.Collection<java.lang.String> paths)
paths - - collection of strings to be addedpublic void addAll(java.lang.String[] paths)
paths - to be addedpublic void addAll(PathSet paths)
paths - to be addedpublic boolean contains(java.lang.String path)
path - we are looking for in the set.boolean remove(java.lang.String path)
path - the path to removepublic java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>public java.util.Collection<java.lang.String> paths()
pathsSetpublic void addPrefix(java.lang.String prefix)
prefix - to be added to all itemspublic int size()
public void addAllFilesInDirectory(java.io.File directory,
java.lang.String prefix)
directory - that will be searched for file's paths to addprefix - to be added to all found filespublic static java.lang.String normalizeFilePathStatic(java.lang.String path)
path - to normalizationpublic static java.lang.String trimTrailingSlashes(java.lang.String str)
str - a string