-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SCM-914] Introduce properly typed last modified date
Populate it with svnexe, gitexe and JGit providers
- Loading branch information
Showing
8 changed files
with
208 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,14 @@ | |
*/ | ||
package org.apache.maven.scm.command.info; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.time.temporal.TemporalAccessor; | ||
|
||
/** | ||
* Encapsulates meta information about one file (or directory) being managed with an SCM. | ||
* | ||
* For historical reasons the field/method names are inspired from (and sometimes only applicable to) the <a href="https://svnbook.red-bean.com/">Subversion SCM</a>. | ||
* | ||
* @author <a href="mailto:[email protected]">Kenney Westerhof</a> | ||
* @author Olivier Lamy | ||
* | ||
|
@@ -45,6 +52,8 @@ public class InfoItem { | |
|
||
private String lastChangedDate; | ||
|
||
private OffsetDateTime lastChangedDateTime; | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
@@ -117,11 +126,31 @@ public void setLastChangedRevision(String lastChangedRevision) { | |
this.lastChangedRevision = lastChangedRevision; | ||
} | ||
|
||
/** | ||
* @deprecated Use {@link #getLastModifiedDate()} instead | ||
*/ | ||
@Deprecated | ||
public String getLastChangedDate() { | ||
return lastChangedDate; | ||
} | ||
|
||
/** | ||
* @deprecated Use {@link #setLastModifiedDate(TemporalAccessor)} instead | ||
*/ | ||
@Deprecated | ||
public void setLastChangedDate(String lastChangedDate) { | ||
this.lastChangedDate = lastChangedDate; | ||
} | ||
|
||
/** | ||
* | ||
* @return the date when the file indicated via {@link #getPath()} has been changed in the SCM for the last time | ||
*/ | ||
OffsetDateTime getLastModifiedDate() { | ||
return lastChangedDateTime; | ||
} | ||
|
||
public void setLastModifiedDate(TemporalAccessor accessor) { | ||
this.lastChangedDateTime = OffsetDateTime.from(accessor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.