Class DeferredSymlinks
- java.lang.Object
-
- org.codehaus.plexus.archiver.util.DeferredSymlinks
-
public final class DeferredSymlinks extends java.lang.ObjectSymbolic links the file system refused, to be replaced by a copy of their target once every entry is on disk.- Since:
- 4.15.0
- See Also:
SymlinkFailureMode.COPY_TARGET
-
-
Constructor Summary
Constructors Constructor Description DeferredSymlinks(org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.nio.file.Path root, java.io.File link, java.lang.String target, java.lang.String entryName)Records a link that could not be created.voidresolve()Copies the target of each recorded link in place of the link.
-
-
-
Method Detail
-
add
public void add(java.nio.file.Path root, java.io.File link, java.lang.String target, java.lang.String entryName) throws java.io.IOExceptionRecords a link that could not be created.- Parameters:
root- the canonical directory the copy must stay insidelink- where the link would have been created; its parent directory must existtarget- the link target as stored in the archive or resourceentryName- the entry name, for messages- Throws:
java.io.IOException- if the parent directory cannot be canonicalized
-
resolve
public void resolve() throws java.io.IOExceptionCopies the target of each recorded link in place of the link. Repeats until no more links resolve, so links that precede their target and chains of links work in any order. Targets outside the root, missing targets, cycles, occupied link paths and directories that contain the link are skipped with a warning.- Throws:
java.io.IOException- if copying fails
-
-