Skip to content

Commit c1fe527

Browse files
author
Niklas Schultz
committed
Renamed ChangeFile time methods
Also fixed small typo in JavaDoc
1 parent 90cb104 commit c1fe527

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Example implements DirectoryWatchable {
2020
// what file is the event referring to:
2121
System.out.println(changedFile.getAbsolutePath());
2222
// when did it happen:
23-
System.out.println(changedFile.whenAsString());
23+
System.out.println(changedFile.getChangeTime());
2424
// you could also call the toString method to get all of the information above:
2525
System.out.println(changedFile.toString());
2626
}

src/main/java/nschultz/watcher/core/ChangedFile.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class ChangedFile {
6060
*
6161
* @return the time of change
6262
*/
63-
public final Date when() {
63+
public final Date getChangeTime() {
6464
return changeTime;
6565
}
6666

@@ -70,8 +70,8 @@ public final Date when() {
7070
*
7171
* @return the time when this file was changed
7272
*/
73-
public final String whenAsString() {
74-
return whenAsString("yyyy-MM-dd HH:mm:ss");
73+
public final String getChangeTimeFormatted() {
74+
return getChangeTimeFormatted("yyyy-MM-dd HH:mm:ss");
7575
}
7676

7777
/**
@@ -80,7 +80,7 @@ public final String whenAsString() {
8080
* @param format the way the time will be formatted before it gets returned
8181
* @return the time when this file was changed
8282
*/
83-
public final String whenAsString(final String format) {
83+
public final String getChangeTimeFormatted(final String format) {
8484
return new SimpleDateFormat(format).format(changeTime);
8585
}
8686

src/main/java/nschultz/watcher/core/DirectoryWatchable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface DirectoryWatchable {
5050
* the set error stream.
5151
*
5252
* @param ex an instance of the {@code {@link IOException}} that occurred
53-
* while trying to watch the director for changes
53+
* while trying to watch the directory for changes
5454
*/
5555
default void failed(IOException ex) {
5656
ex.printStackTrace(System.err);

0 commit comments

Comments
 (0)