public class RepositoryRequest extends Object
| Modifier and Type | Field and Description |
|---|---|
private PathParser |
defaultPathParser |
| Constructor and Description |
|---|
RepositoryRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isArchetypeCatalog(String requestedPath) |
boolean |
isDefault(String requestedPath)
Tests the path to see if it conforms to the expectations of a default layout request.
|
boolean |
isLegacy(String requestedPath)
Tests the path to see if it conforms to the expectations of a legacy layout request.
|
boolean |
isMetadata(String requestedPath)
Tests the path to see if it conforms to the expectations of a metadata request.
|
boolean |
isMetadataSupportFile(String requestedPath) |
boolean |
isSupportFile(String requestedPath)
Tests the path to see if it conforms to the expectations of a support file request.
|
ArtifactReference |
toArtifactReference(String requestedPath)
Takes an incoming requested path (in "/" format) and gleans the layout
and ArtifactReference appropriate for that content.
|
String |
toNativePath(String requestedPath,
ManagedRepositoryContent repository)
Adjust the requestedPath to conform to the native layout of the provided
ManagedRepositoryContent. |
private PathParser defaultPathParser
public RepositoryRequest()
public ArtifactReference toArtifactReference(String requestedPath) throws LayoutException
requestedPath - the relative path to the content.LayoutException - if the request path is not layout valid.public boolean isMetadata(String requestedPath)
Tests the path to see if it conforms to the expectations of a metadata request.
NOTE: This does a cursory check on the path's last element. A result of true from this method is not a guarantee that the metadata is in a valid format, or that it even contains data.
requestedPath - the path to test.public boolean isArchetypeCatalog(String requestedPath)
requestedPath - public boolean isSupportFile(String requestedPath)
Tests the path to see if it conforms to the expectations of a support file request.
Tests for .sha1, .md5, .asc, and .php.
NOTE: This does a cursory check on the path's extension only. A result of true from this method is not a guarantee that the support resource is in a valid format, or that it even contains data.
requestedPath - the path to test.public boolean isMetadataSupportFile(String requestedPath)
public boolean isDefault(String requestedPath)
Tests the path to see if it conforms to the expectations of a default layout request.
NOTE: This does a cursory check on the count of path elements only. A result of
true from this method is not a guarantee that the path sections are valid and
can be resolved to an artifact reference. use toArtifactReference(String)
if you want a more complete analysis of the validity of the path.
requestedPath - the path to test.public boolean isLegacy(String requestedPath)
Tests the path to see if it conforms to the expectations of a legacy layout request.
NOTE: This does a cursory check on the count of path elements only. A result of
true from this method is not a guarantee that the path sections are valid and
can be resolved to an artifact reference. use toArtifactReference(String)
if you want a more complete analysis of the validity of the path.
requestedPath - the path to test.public String toNativePath(String requestedPath, ManagedRepositoryContent repository) throws LayoutException
ManagedRepositoryContent.requestedPath - the incoming requested path.repository - the repository to adjust to.LayoutException - if the path cannot be parsed.Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.