/** * Returns the last modified date of the given file node. The value is * read from the jcr:lastModified property of this node or alternatively * from a jcr:content child node. * * @since Apache Jackrabbit 2.3 * @param node file node * @return last modified date, or <code>null</code> if not available * @throws RepositoryException if the last modified date can not be accessed */ public static Calendar getLastModified(Node node) throws RepositoryException { if (node.hasProperty(Property.JCR_LAST_MODIFIED)) { return node.getProperty(Property.JCR_LAST_MODIFIED).getDate(); } else if (node.hasNode(Node.JCR_CONTENT)) { return getLastModified(node.getNode(Node.JCR_CONTENT)); } else { return null; } }
/** * Returns the last modified date of the given file node. The value is * read from the jcr:lastModified property of this node or alternatively * from a jcr:content child node. * * @since Apache Jackrabbit 2.3 * @param node file node * @return last modified date, or <code>null</code> if not available * @throws RepositoryException if the last modified date can not be accessed */ public static Calendar getLastModified(Node node) throws RepositoryException { if (node.hasProperty(Property.JCR_LAST_MODIFIED)) { return node.getProperty(Property.JCR_LAST_MODIFIED).getDate(); } else if (node.hasNode(Node.JCR_CONTENT)) { return getLastModified(node.getNode(Node.JCR_CONTENT)); } else { return null; } }
/** * Returns the last modified date of the given file node. The value is * read from the jcr:lastModified property of this node or alternatively * from a jcr:content child node. * * @since Apache Jackrabbit 2.3 * @param node file node * @return last modified date, or <code>null</code> if not available * @throws RepositoryException if the last modified date can not be accessed */ public static Calendar getLastModified(Node node) throws RepositoryException { if (node.hasProperty(Property.JCR_LAST_MODIFIED)) { return node.getProperty(Property.JCR_LAST_MODIFIED).getDate(); } else if (node.hasNode(Node.JCR_CONTENT)) { return getLastModified(node.getNode(Node.JCR_CONTENT)); } else { return null; } }
Calendar nodeLastMod = JcrUtils.getLastModified(node); if (!nodeLastMod.before(fileLastMod)) { log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.", if (targetParent.hasNode(targetName)) { Node targetNode = targetParent.getNode(targetName); Calendar nodeLastMod = JcrUtils.getLastModified(targetNode); if (!nodeLastMod.before(fileLastMod)) { log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.",
Calendar nodeLastMod = JcrUtils.getLastModified(node); if (!nodeLastMod.before(fileLastMod)) { log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.", if (targetParent.hasNode(targetName)) { Node targetNode = targetParent.getNode(targetName); Calendar nodeLastMod = JcrUtils.getLastModified(targetNode); if (!nodeLastMod.before(fileLastMod)) { log.info("File '{}' does not have a newer timestamp than '{}'. Skipping import.",