public final class ContentSet extends HashStructureAdapter
Project
. The
ContentSet is a composite data structure, meaning that a
particular ContentSet instance may be composed of other ContentSet
instances.The base (or non-recursive) portion of ContentSet is comprised of two parts:
URLPath
filtered by PatternFilters
, and
Modifier and Type | Class and Description |
---|---|
class |
ContentSet.URLIterator |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
URL_PATH_KEY |
_hash
Constructor and Description |
---|
ContentSet(HashStructure contentSetHash)
Creates a ContentSet that is bound to the specified HashStructure.
|
ContentSet(HashStructure contentSetHash,
boolean persistentComposite)
Creates a ContentSet that is bound to the specified HashStructure.
|
Modifier and Type | Method and Description |
---|---|
void |
addContentSet(ContentSet contentSet) |
void |
addMiscellaneousFile(java.net.URL url)
Tracks the specified URL as being part of the static content path.
|
boolean |
canHaveMember(java.net.URL url)
Tests whether the specified URL can be a member of this ContentSet.
|
int |
countContentSets() |
URLPath |
getAllRootDirs()
Returns all root URLs associated with this content set and all
constituent content sets recursively.
|
java.net.URL |
getContentFolderURL()
Returns the URL of the content folder for with this ContentSet.
|
ContentSet |
getContentSet(int index) |
java.lang.String |
getContentSetName() |
java.util.List |
getDirectories(java.lang.String relPath)
Returns the first level of subdirectories (i.e.
|
java.util.List |
getDirectories(java.lang.String relPath,
IntersectedFilters additionalFilters) |
java.util.List |
getDirectories(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
static PatternFilters |
getExcludeJprJwsFilters() |
java.util.List |
getFiles(java.lang.String relPath)
Returns the first level of files (i.e.
|
java.util.List |
getFiles(java.lang.String relPath,
IntersectedFilters additionalFilters) |
java.util.List |
getFiles(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
java.util.List |
getFilesAndDirectories(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
static ContentSet |
getInstance(PropertyStorage project,
java.lang.String contentSetKey)
Creates a ContentSet wrapper for the HashStructure in the project
at the specified key.
|
java.util.List |
getNodes(java.lang.String relPath) |
java.util.List |
getNodes(java.lang.String relPath,
IntersectedFilters additionalFilters) |
java.util.List |
getNodes(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
PatternFilters |
getPatternFilters()
Returns the PatternFilters of the dynamic content path of this
ContentSet.
|
URLPath |
getURLPath()
Returns the URLPath of the dynamic content path of this ContentSet.
|
java.util.Iterator |
nodeIterator(java.lang.String relPath)
Returns an Iterator that iterates over all files in this
ContentSet starting at the specified relative path.
|
java.util.Iterator |
nodeIterator(java.lang.String relPath,
IntersectedFilters additionalFilters) |
java.util.Iterator |
nodeIterator(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
void |
removeAllContentSets() |
void |
removeContentSet(int index) |
boolean |
removeMiscellaneousFile(java.net.URL url)
Removes the specified URL from the static content path.
|
void |
setContentFolderURL(java.net.URL contentFolderURL)
Sets the URL for the content folder for this content
set.
|
ContentSet |
setContentSet(int index,
ContentSet contentSet) |
java.net.URL |
toQualifiedURL(java.lang.String relPath)
Returns the fully-qualified URL of the specified relPath relative
to this ContentSet.
|
java.lang.String |
toRelativePath(java.net.URL url)
Returns the relative path for the specified URL relative to this
ContentSet.
|
java.util.Iterator |
urlIterator(java.lang.String relPath)
Returns an Iterator that iterates over all files in this
ContentSet starting at the specified relative path.
|
java.util.Iterator |
urlIterator(java.lang.String relPath,
IntersectedFilters additionalFilters) |
java.util.Iterator |
urlIterator(java.lang.String relPath,
IntersectedFilters additionalFilters,
URLFilter urlFilter) |
addStructureChangeListener, containsKey, copyTo, copyToImpl, equals, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
public static final java.lang.String URL_PATH_KEY
public ContentSet(HashStructure contentSetHash)
public ContentSet(HashStructure contentSetHash, boolean persistentComposite)
public static PatternFilters getExcludeJprJwsFilters()
public static ContentSet getInstance(PropertyStorage project, java.lang.String contentSetKey)
public java.lang.String getContentSetName()
public URLPath getURLPath()
public java.net.URL getContentFolderURL()
Note that this will be generally be null
, except
in the case where a content folder is necessary to define the
content type. For Java content, both a source root URL, and a
contentFolderURL
URL are required when the project
content refers to a folder underneath the source root.
public void setContentFolderURL(java.net.URL contentFolderURL)
Note this should only be necessary for special content types.
Java content, for example, requires both an URL which is the
source root, and a contentFolderURL
which refers
to a folder underneath the source root, whose content to include
in the project.
contentFolderURL
- an URL or null to indicate that
the content folder is identical to the source root.public URLPath getAllRootDirs()
public PatternFilters getPatternFilters()
public boolean canHaveMember(java.net.URL url)
public void addMiscellaneousFile(java.net.URL url)
public boolean removeMiscellaneousFile(java.net.URL url)
public void addContentSet(ContentSet contentSet)
public int countContentSets()
public ContentSet getContentSet(int index)
public ContentSet setContentSet(int index, ContentSet contentSet)
public void removeAllContentSets()
public void removeContentSet(int index)
public java.util.List getDirectories(java.lang.String relPath)
public java.util.List getDirectories(java.lang.String relPath, IntersectedFilters additionalFilters)
public java.util.List getDirectories(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)
public java.util.List getFiles(java.lang.String relPath)
public java.util.List getFiles(java.lang.String relPath, IntersectedFilters additionalFilters)
public java.util.List getFiles(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)
public java.util.List getFilesAndDirectories(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)
public java.util.List getNodes(java.lang.String relPath)
public java.util.List getNodes(java.lang.String relPath, IntersectedFilters additionalFilters)
public java.util.List getNodes(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)
public java.net.URL toQualifiedURL(java.lang.String relPath)
null
is returned.
All relevant filters are applied in determining the URL, so calling
canHaveMember(java.net.URL)
with the URL would return true
.public java.lang.String toRelativePath(java.net.URL url)
null
is returned.
All relevant filters are applied in determining the relative path,
so if the returned String is not null, calling toQualifiedURL(java.lang.String)
with the relative path should return the
original URL.
public java.util.Iterator urlIterator(java.lang.String relPath)
The Iterator operates lazily, meaning that it retrieves the file listings one directory at a time as the iteration is occurring rather than all up front before iteration starts.
public java.util.Iterator urlIterator(java.lang.String relPath, IntersectedFilters additionalFilters)
public java.util.Iterator urlIterator(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)
public java.util.Iterator nodeIterator(java.lang.String relPath)
The Iterator operates lazily, meaning that it retrieves the file listings one directory at a time as the iteration is occurring rather than all up front before iteration starts. Node instances are only created, if necessary, when the Iterator's next() method is called.
public java.util.Iterator nodeIterator(java.lang.String relPath, IntersectedFilters additionalFilters)
public java.util.Iterator nodeIterator(java.lang.String relPath, IntersectedFilters additionalFilters, URLFilter urlFilter)