public class PathSet extends Object implements Iterable<String>
Constructor and Description |
---|
PathSet()
Creates an empty paths set
|
PathSet(Collection<String> paths)
Creates paths set and normalizate and adds all 'paths'.
|
PathSet(String[] paths)
Creates paths set and normalizate and adds all 'paths'.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String path)
Normalizes and adds given path 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 |
addAll(PathSet paths)
Adds given paths to the set.
|
void |
addAll(PathSet paths,
String prefix)
Adds given paths to the set.
|
void |
addAll(String[] paths)
Normalizes and adds given paths to the set.
|
void |
addAll(String[] paths,
String prefix)
Normalizes and adds given paths to the set.
|
void |
addAllFilesInDirectory(File directory,
String prefix)
Adds to the set all files in the given directory
|
void |
addPrefix(String prefix)
Adds given prefix to all paths in the set.
|
boolean |
contains(String path)
Checks if the set constains given path.
|
Iterator<String> |
iterator()
Returns iterator of normalized paths (strings)
|
protected String |
normalizeFilePath(String path)
The method normalizes the path.
|
static String |
normalizeFilePathStatic(String path)
The method normalizes the path.
|
Collection<String> |
paths() |
int |
size()
Returns count of the paths in the set
|
static String |
trimTrailingSlashes(String str)
The method deletes all trailing slashes from the given string
|
public PathSet()
public PathSet(Collection<String> paths)
paths
- to be addedpublic PathSet(String[] paths)
paths
- to be addedprotected String normalizeFilePath(String path)
path
- to normalizationpublic void add(String path)
path
- to be addedpublic void addAll(Collection<String> paths, String prefix)
paths
- - collection of strings to be addedprefix
- added to all given pathspublic void addAll(String[] paths, String prefix)
paths
- to be addedprefix
- added to all given pathspublic void addAll(PathSet paths, String prefix)
paths
- to be addedprefix
- added to all given pathspublic void addAll(Collection<String> paths)
paths
- - collection of strings to be addedpublic void addAll(String[] paths)
paths
- to be addedpublic void addAll(PathSet paths)
paths
- to be addedpublic boolean contains(String path)
path
- we are looking for in the set.public Collection<String> paths()
public void addPrefix(String prefix)
prefix
- to be added to all itemspublic int size()
public void addAllFilesInDirectory(File directory, String prefix)
directory
- that will be searched for file's paths to addprefix
- to be added to all found filespublic static String normalizeFilePathStatic(String path)
path
- to normalizationCopyright © 2002–2014 The Apache Software Foundation. All rights reserved.