Class DeferredSymlinks

java.lang.Object
org.codehaus.plexus.archiver.util.DeferredSymlinks

public final class DeferredSymlinks extends Object
Symbolic 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:
  • Constructor Details

    • DeferredSymlinks

      public DeferredSymlinks(org.slf4j.Logger logger)
  • Method Details

    • add

      public void add(Path root, File link, String target, String entryName) throws IOException
      Records a link that could not be created.
      Parameters:
      root - the canonical directory the copy must stay inside
      link - where the link would have been created; its parent directory must exist
      target - the link target as stored in the archive or resource
      entryName - the entry name, for messages
      Throws:
      IOException - if the parent directory cannot be canonicalized
    • resolve

      public void resolve() throws IOException
      Copies 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:
      IOException - if copying fails