public class ChrootWrapper extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
basePrefix
The base prefix.
|
Constructor and Description |
---|
ChrootWrapper(String basePrefix)
Construct a ChrootWrapper with a base prefix.
|
Modifier and Type | Method and Description |
---|---|
Collection |
filterSearchResult(Collection collection)
Filter search results, so the results outside the base prefix will be ignored and results
inside the base prefix will be converted to relative paths.
|
LogEntry[] |
fixLogEntries(LogEntry[] logEntries)
Convert the paths of the log entries to relative values.
|
String |
getBasePrefix()
Method to return the base prefix.
|
String |
getInPath(String path)
Get an absolute path for the given path argument, taking into account both initial
double-slashes (indicating an absolute path) and any basePrefix that has been established.
|
Association[] |
getOutAssociations(Association[] associations)
Return the associations array with converting all to relative paths.
|
Collection |
getOutCollection(Collection collection)
When returning collection (with pagination) it need to unset the collection content.
|
Comment[] |
getOutComments(Comment[] comments)
Method to return the comments with relative paths set.
|
String |
getOutPath(String absolutePath)
Take an absolute path in the "real" registry and convert it to a relative path suitable for
this particular RemoteRegistry (which may be rooted at a particular place).
|
String[] |
getOutPaths(String[] absolutePaths)
returns a set of relative path for the provided absolute paths.
|
Resource |
getOutResource(Resource resource)
The resource needed to be modified in case of out resource
|
TaggedResourcePath[] |
getOutTaggedResourcePaths(TaggedResourcePath[] taggedResourcePaths)
Method to return the tagged resource after converting to relative paths
|
protected String basePrefix
public ChrootWrapper(String basePrefix)
basePrefix
- the base prefix.public String getBasePrefix()
public String getInPath(String path)
path
- a relative pathpublic String getOutPath(String absolutePath)
absolutePath
- a full path from the root of the registry, starting with "/"public String[] getOutPaths(String[] absolutePaths)
absolutePaths
- the array of absolute paths.public Resource getOutResource(Resource resource) throws RegistryException
resource
- the resource that should prepared with chroot to return out.RegistryException
- throws if the operation failed.public Collection getOutCollection(Collection collection) throws RegistryException
collection
- the collection to be prepared with chroot to return out.RegistryException
- throws if the operation failed.public Association[] getOutAssociations(Association[] associations)
associations
- the associations that are in absolute paths.public TaggedResourcePath[] getOutTaggedResourcePaths(TaggedResourcePath[] taggedResourcePaths)
taggedResourcePaths
- the set of tagged resource paths.public Comment[] getOutComments(Comment[] comments)
comments
- the comments with absolute pathspublic Collection filterSearchResult(Collection collection) throws RegistryException
collection
- unfiltered search resultsRegistryException
- throws if the operation failed.Copyright © 2015 WSO2 Inc. All Rights Reserved.