java.lang.Object
com.aoindustries.aoserv.daemon.util.UpgradeSymlink

public class UpgradeSymlink extends Object
Manages symbolic links for Tomcat installations.
Author:
AO Industries, Inc.
  • Constructor Details

    • UpgradeSymlink

      public UpgradeSymlink(String oldLinkPath, String oldLinkTarget, String newLinkPath, String newLinkTarget)
      Parameters:
      oldLinkTarget - if null the link will be created if missing
    • UpgradeSymlink

      public UpgradeSymlink(String linkPath, String oldLinkTarget, String newLinkTarget)
      Parameters:
      oldLinkTarget - if null the link will be created if missing
  • Method Details

    • getOldLinkPath

      public String getOldLinkPath()
      Gets the relative path to the old symlink.
    • getOldLinkTarget

      public String getOldLinkTarget()
      Gets the old target.
    • getNewLinkPath

      public String getNewLinkPath()
      Gets the relative path to the new symlink or null if should not exist.
    • getNewLinkTarget

      public String getNewLinkTarget()
      Gets the new link target or null if should not exist.
    • upgradeLinkTarget

      public boolean upgradeLinkTarget(PosixFile baseDirectory, int uid, int gid) throws IOException
      Updates the symlink if needed. Will also reset the UID and GID if they mismatch.
      Returns:
      true if link modified. UID and GID changes alone will not count as a change.
      Throws:
      IOException