Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.model
Class ContentSet

java.lang.Object
  extended by oracle.javatools.data.HashStructureAdapter
      extended by oracle.ide.model.ContentSet

public final class ContentSet
extends HashStructureAdapter

The ContentSet is the fundamental data structure that describes the contents of a 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:

  1. A dynamic content path, which is the combination of a URLPath filtered by PatternFilters, and
  2. A static content path, which is a list of URLs for files (often called "miscellaenous files") that are meant to be part of the ContentSet but are not on the dynamic content path. (Thus, the PatternFilters from the dynamic content path do not apply to the miscellaneous files.)
The recursive portion of ContentSet is an ordered list of other ("constituent") ContentSet instances. No filters from the base portion are applied to the recursive portion, so a composite ContentSet is basically just the base portion unioned with the union of all ContentSets in the recursive portion.


Nested Class Summary
 class ContentSet.URLIterator
           
 
Field Summary
static java.lang.String URL_PATH_KEY
           
 
Fields inherited from class oracle.javatools.data.HashStructureAdapter
_hash
 
Constructor Summary
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.
 
Method Summary
 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)
           
 
Methods inherited from class oracle.javatools.data.HashStructureAdapter
addStructureChangeListener, containsKey, copyTo, copyToImpl, equals, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PATH_KEY

public static final java.lang.String URL_PATH_KEY
See Also:
Constant Field Values
Constructor Detail

ContentSet

public ContentSet(HashStructure contentSetHash)
Creates a ContentSet that is bound to the specified HashStructure.


ContentSet

public ContentSet(HashStructure contentSetHash,
                  boolean persistentComposite)
Creates a ContentSet that is bound to the specified HashStructure. The persistentComposite flag indicates whether or not constituent ContentSet objects are modified at the HashStructure level when adding or removing a ContentSet. In general, persistentComposite should be true. However, passing in false is useful when building a programmatic, composite ContentSet which itself is not persistent but is made up of constituents that are persistent.

Method Detail

getExcludeJprJwsFilters

public static PatternFilters getExcludeJprJwsFilters()

getInstance

public static ContentSet getInstance(PropertyStorage project,
                                     java.lang.String contentSetKey)
Creates a ContentSet wrapper for the HashStructure in the project at the specified key.


getContentSetName

public java.lang.String getContentSetName()

getURLPath

public URLPath getURLPath()
Returns the URLPath of the dynamic content path of this ContentSet. The URLPath object is "live", so any changes made to it will write through to the underlying HashStructure.


getContentFolderURL

public java.net.URL getContentFolderURL()
Returns the URL of the content folder for with this ContentSet.

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.

Returns:
the content folder URL, or null

setContentFolderURL

public void setContentFolderURL(java.net.URL contentFolderURL)
Sets the URL for the content folder for this content set.

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.

Parameters:
contentFolderURL - an URL or null to indicate that the content folder is identical to the source root.

getAllRootDirs

public URLPath getAllRootDirs()
Returns all root URLs associated with this content set and all constituent content sets recursively. The returned URLPath is a defensive copy, so modifications made to it will not affect the original ContentSet.


getPatternFilters

public PatternFilters getPatternFilters()
Returns the PatternFilters of the dynamic content path of this ContentSet. The PatternFilters object is "live", so any changes made to it will write through to the underlying HashStructure.


canHaveMember

public boolean canHaveMember(java.net.URL url)
Tests whether the specified URL can be a member of this ContentSet. The return value is determined only by testing whether the URL is accepted by the dynamic content path, static content path, or any constituent ContentSet. This method doesn't perform any I/O operations, so the URL is not tested for existence. If existence is important to know, the caller will also need to call URLFileSystem.exists(url).


addMiscellaneousFile

public void addMiscellaneousFile(java.net.URL url)
Tracks the specified URL as being part of the static content path. The URL will not subject to any filters.


removeMiscellaneousFile

public boolean removeMiscellaneousFile(java.net.URL url)
Removes the specified URL from the static content path.


addContentSet

public void addContentSet(ContentSet contentSet)

countContentSets

public int countContentSets()

getContentSet

public ContentSet getContentSet(int index)

setContentSet

public ContentSet setContentSet(int index,
                                ContentSet contentSet)

removeAllContentSets

public void removeAllContentSets()

removeContentSet

public void removeContentSet(int index)

getDirectories

public java.util.List getDirectories(java.lang.String relPath)
Returns the first level of subdirectories (i.e. not recursively) in the ContentSet starting at the specified relative path. The directories are returned as a list of Strings. Each string is relative to this ContentSet, rather than to the specified relPath.


getDirectories

public java.util.List getDirectories(java.lang.String relPath,
                                     IntersectedFilters additionalFilters)

getDirectories

public java.util.List getDirectories(java.lang.String relPath,
                                     IntersectedFilters additionalFilters,
                                     URLFilter urlFilter)

getFiles

public java.util.List getFiles(java.lang.String relPath)
Returns the first level of files (i.e. not recursively) in the ContentSet starting at the specified relative path. The files are returned as a list of fully-qualified URLs. Only URLs for existing files that pass all filters are returned.


getFiles

public java.util.List getFiles(java.lang.String relPath,
                               IntersectedFilters additionalFilters)

getFiles

public java.util.List getFiles(java.lang.String relPath,
                               IntersectedFilters additionalFilters,
                               URLFilter urlFilter)

getFilesAndDirectories

public java.util.List getFilesAndDirectories(java.lang.String relPath,
                                             IntersectedFilters additionalFilters,
                                             URLFilter urlFilter)

getNodes

public java.util.List getNodes(java.lang.String relPath)

getNodes

public java.util.List getNodes(java.lang.String relPath,
                               IntersectedFilters additionalFilters)

getNodes

public java.util.List getNodes(java.lang.String relPath,
                               IntersectedFilters additionalFilters,
                               URLFilter urlFilter)

toQualifiedURL

public java.net.URL toQualifiedURL(java.lang.String relPath)
Returns the fully-qualified URL of the specified relPath relative to this ContentSet. If the relPath cannot be qualified, null is returned. All relevant filters are applied in determining the URL, so calling canHaveMember(java.net.URL) with the URL would return true.


toRelativePath

public java.lang.String toRelativePath(java.net.URL url)
Returns the relative path for the specified URL relative to this ContentSet. If the URL could not be made relative to any part of the ContentSet, then 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.


urlIterator

public 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. All objects in the Iterator are of type URL. If the relPath is null or the empty string, the entire ContentSet will be iterated.

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.


urlIterator

public java.util.Iterator urlIterator(java.lang.String relPath,
                                      IntersectedFilters additionalFilters)

urlIterator

public java.util.Iterator urlIterator(java.lang.String relPath,
                                      IntersectedFilters additionalFilters,
                                      URLFilter urlFilter)

nodeIterator

public 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. All objects in the Iterator are of type Node. If the relPath is null or the empty string, the entire ContentSet will be iterated.

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.


nodeIterator

public java.util.Iterator nodeIterator(java.lang.String relPath,
                                       IntersectedFilters additionalFilters)

nodeIterator

public java.util.Iterator nodeIterator(java.lang.String relPath,
                                       IntersectedFilters additionalFilters,
                                       URLFilter urlFilter)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.