Package org.apache.hadoop.fs
Class FSLinkResolver<T>
java.lang.Object
org.apache.hadoop.fs.FSLinkResolver<T>
- Direct Known Subclasses:
FsLinkResolution
Used primarily by
FileContext to operate on and resolve
symlinks in a path. Operations can potentially span multiple
AbstractFileSystems.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tnext(AbstractFileSystem fs, Path p) Generic helper function overridden on instantiation to perform a specific operation on the given file system using the given path which may result in an UnresolvedLinkException.static PathqualifySymlinkTarget(URI pathURI, Path pathWithLink, Path target) Return a fully-qualified version of the given symlink target if it has no scheme and authority.resolve(FileContext fc, Path path) Performs the operation specified by the next function, calling it repeatedly until all symlinks in the given path are resolved.
-
Constructor Details
-
FSLinkResolver
public FSLinkResolver()
-
-
Method Details
-
qualifySymlinkTarget
Return a fully-qualified version of the given symlink target if it has no scheme and authority. Partially and fully-qualified paths are returned unmodified.- Parameters:
pathURI- URI of the filesystem of pathWithLinkpathWithLink- Path that contains the symlinktarget- The symlink's absolute target- Returns:
- Fully qualified version of the target.
-
next
Generic helper function overridden on instantiation to perform a specific operation on the given file system using the given path which may result in an UnresolvedLinkException.- Parameters:
fs- AbstractFileSystem to perform the operation on.p- Path given the file system.- Returns:
- Generic type determined by the specific implementation.
- Throws:
UnresolvedLinkException- If symbolic linkpathcould not be resolvedIOException- an I/O error occurred
-
resolve
Performs the operation specified by the next function, calling it repeatedly until all symlinks in the given path are resolved.- Parameters:
fc- FileContext used to access file systems.path- The path to resolve symlinks on.- Returns:
- Generic type determined by the implementation of next.
- Throws:
IOException- raised on errors performing I/O.
-