Note that pathToCombine must be a relative path. For example, /foo/bar/ joined with biz/somefile.txt would yield /foo/bar/biz/somefile.txt. @throws InvalidPathException If the base path is a file path. @param pathToCombine Path to combine with this path. @return Combined path.
@param currentDomains the ProtectionDomains associated with thecurrent execution Thread, up to the most recent privileged ProtectionDomain
. The ProtectionDomains are are listed in order of execution, with the most recently executing ProtectionDomain
residing at the beginning of the array. This parameter may be null
if the current execution Thread has no associated ProtectionDomains.
@param assignedDomains an array of inherited ProtectionDomains.ProtectionDomains may be inherited from a parent Thread, or from a privileged AccessControlContext
. This parameter may be null
if there are no inherited ProtectionDomains.
@return a new array consisting of the updated ProtectionDomains,or null
.
A new {@code ProtectionDomain} instance is createdfor each {@code ProtectionDomain} in thecurrentDomains array. Each new {@code ProtectionDomain}instance is created using the {@code CodeSource}, {@code Permission}s and {@code ClassLoader}from the corresponding {@code ProtectionDomain} incurrentDomains, as well as with the Principals from the {@code Subject} associated with this{@code SubjectDomainCombiner}.
All of the newly instantiated ProtectionDomains are combined into a new array. The ProtectionDomains from the assignedDomains array are appended to this new array, and the result is returned.
Note that optimizations such as the removal of duplicate ProtectionDomains may have occurred. In addition, caching of ProtectionDomains may be permitted.
@param currentDomains the ProtectionDomains associated with thecurrent execution Thread, up to the most recent privileged {@code ProtectionDomain}. The ProtectionDomains are are listed in order of execution, with the most recently executing {@code ProtectionDomain}residing at the beginning of the array. This parameter may be {@code null} if the current execution Threadhas no associated ProtectionDomains.
@param assignedDomains the ProtectionDomains inherited from theparent Thread, or the ProtectionDomains from the privileged context, if a call to AccessController.doPrivileged(..., context) had occurred This parameter may be {@code null}if there were no ProtectionDomains inherited from the parent Thread, or from the privileged context. @return a new array consisting of the updated ProtectionDomains,or {@code null}.
This implementation simply concatenates the two patterns, unless the first pattern contains a file extension match (such as {@code *.html}. In that case, the second pattern should be included in the first, or an {@code IllegalArgumentException} is thrown.
For example:
Pattern 1 | Pattern 2 | Result |
---|---|---|
/hotels | {@code null} | /hotels |
{@code null} | /hotels | /hotels |
/hotels | /bookings | /hotels/bookings |
/hotels | bookings | /hotels/bookings |
/hotels/* | /bookings | /hotels/bookings |
/hotels/** | /bookings | /hotels/**/bookings |
/hotels | {hotel} | /hotels/{hotel} |
/hotels/* | {hotel} | /hotels/{hotel} |
/hotels/** | {hotel} | /hotels/**/{hotel} |
/*.html | /hotels.html | /hotels.html |
/*.html | /hotels | /hotels.html |
/*.html | /*.txt | IllegalArgumentException |
The full algorithm used for combining the two pattern depends on the underlying implementation. @param pattern1 the first pattern @param pattern2 the second pattern @return the combination of the two patterns @throws IllegalArgumentException when the two patterns cannot be combined
Example: combine type- and method-level request mappings. @return a new request mapping info instance; never {@code null}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|