Beispiel #1
0
  /**
   * Checks if a file has been modified by comparing the last update date of both files and
   * Artifact. If they are different, the file is assumed to have been modified.
   *
   * @param artifact artifact to check for modification
   * @return boolean value of artifact modified or not
   */
  public static boolean isArtifactModified(Artifact artifact) {
    long currentTimeStamp = artifact.getLastModifiedTime();

    setArtifactLastModifiedTime(artifact);

    return (currentTimeStamp != artifact.getLastModifiedTime());
  }
Beispiel #2
0
 /**
  * Sets the last modified time to the given artifact
  *
  * @param artifact artifact for update modified time
  */
 public static void setArtifactLastModifiedTime(Artifact artifact) {
   File file = artifact.getFile();
   if (file != null && (artifact.getLastModifiedTime() < file.lastModified())) {
     artifact.setLastModifiedTime(file.lastModified());
   }
 }