public void rollback(File deployArea) throws IOException, SAXException, TikaException {
        LinkContentHandler handler = new LinkContentHandler();
        Metadata met = new Metadata();
        DeploymentAreaParser parser = new DeploymentAreaParser();
        parser.parse(IOUtils.toInputStream(deployArea.getAbsolutePath(), UTF_8), handler, met);
        List<Link> links = handler.getLinks();
        if (links.size() < 2) {
            throw new IOException("Must have installed at least 2 versions!");
        }
        links.sort(Comparator.comparing(Link::getText));

        this.updateVersion(links
                .get(links.size() - 2)
                .getText());
    }
Demonstrates Tika and its ability to sense symlinks.
tika-example/src/main/java/org/apache/tika/example/RollbackSoftware.java