Class DeferredSymlinks


  • public final class DeferredSymlinks
    extends java.lang.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:
    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
      void add​(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.
      void resolve()
      Copies the target of each recorded link in place of the link.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeferredSymlinks

        public DeferredSymlinks​(org.slf4j.Logger logger)
    • 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.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:
        java.io.IOException - if the parent directory cannot be canonicalized
      • resolve

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