Skip to content

Commit 8baef22

Browse files
committed
Remove deprecated lastModified methods using long
from - FileUtils#lastModified - FileUtils#setLastModified - FS#getLastModifiedTime - FS#lastModified - FS#setLastModified - FileTreeIterator.Entry#getEntryLastModified - WorkingTreeIterator#getEntryLastModified - WorkingTreeIterator.Entry#getEntryLastModified Change-Id: I5073f05c32f8f626383a91048470c79332983121
1 parent 88053ee commit 8baef22

File tree

4 files changed

+0
-116
lines changed

4 files changed

+0
-116
lines changed

org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,6 @@ public long getLength() {
371371
return attributes.getLength();
372372
}
373373

374-
@Override
375-
@Deprecated
376-
public long getLastModified() {
377-
return attributes.getLastModifiedInstant().toEpochMilli();
378-
}
379-
380374
/**
381375
* @since 5.1.9
382376
*/

org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,6 @@ public long getEntryContentLength() throws IOException {
619619
return canonLen;
620620
}
621621

622-
/**
623-
* Get the last modified time of this entry.
624-
*
625-
* @return last modified time of this file, in milliseconds since the epoch
626-
* (Jan 1, 1970 UTC).
627-
* @deprecated use {@link #getEntryLastModifiedInstant()} instead
628-
*/
629-
@Deprecated
630-
public long getEntryLastModified() {
631-
return current().getLastModified();
632-
}
633-
634622
/**
635623
* Get the last modified time of this entry.
636624
*
@@ -1222,21 +1210,6 @@ public String toString() {
12221210
*/
12231211
public abstract long getLength();
12241212

1225-
/**
1226-
* Get the last modified time of this entry.
1227-
* <p>
1228-
* <b>Note: Efficient implementation required.</b>
1229-
* <p>
1230-
* The implementation of this method must be efficient. If a subclass
1231-
* needs to compute the value they should cache the reference within an
1232-
* instance member instead.
1233-
*
1234-
* @return time since the epoch (in ms) of the last change.
1235-
* @deprecated use {@link #getLastModifiedInstant()} instead
1236-
*/
1237-
@Deprecated
1238-
public abstract long getLastModified();
1239-
12401213
/**
12411214
* Get the last modified time of this entry.
12421215
* <p>

org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,24 +1080,6 @@ private void detectSymlinkSupport() {
10801080
*/
10811081
public abstract boolean setExecute(File f, boolean canExec);
10821082

1083-
/**
1084-
* Get the last modified time of a file system object. If the OS/JRE support
1085-
* symbolic links, the modification time of the link is returned, rather
1086-
* than that of the link target.
1087-
*
1088-
* @param f
1089-
* a {@link java.io.File} object.
1090-
* @return last modified time of f
1091-
* @throws java.io.IOException
1092-
* if an IO error occurred
1093-
* @since 3.0
1094-
* @deprecated use {@link #lastModifiedInstant(Path)} instead
1095-
*/
1096-
@Deprecated
1097-
public long lastModified(File f) throws IOException {
1098-
return FileUtils.lastModified(f);
1099-
}
1100-
11011083
/**
11021084
* Get the last modified time of a file system object. If the OS/JRE support
11031085
* symbolic links, the modification time of the link is returned, rather
@@ -1126,25 +1108,6 @@ public Instant lastModifiedInstant(File f) {
11261108
return FileUtils.lastModifiedInstant(f.toPath());
11271109
}
11281110

1129-
/**
1130-
* Set the last modified time of a file system object.
1131-
* <p>
1132-
* For symlinks it sets the modified time of the link target.
1133-
*
1134-
* @param f
1135-
* a {@link java.io.File} object.
1136-
* @param time
1137-
* last modified time
1138-
* @throws java.io.IOException
1139-
* if an IO error occurred
1140-
* @since 3.0
1141-
* @deprecated use {@link #setLastModified(Path, Instant)} instead
1142-
*/
1143-
@Deprecated
1144-
public void setLastModified(File f, long time) throws IOException {
1145-
FileUtils.setLastModified(f, time);
1146-
}
1147-
11481111
/**
11491112
* Set the last modified time of a file system object.
11501113
* <p>
@@ -2425,19 +2388,6 @@ public long getCreationTime() {
24252388
return creationTime;
24262389
}
24272390

2428-
/**
2429-
* Get the time when the file was last modified in milliseconds since
2430-
* the epoch
2431-
*
2432-
* @return the time (milliseconds since 1970-01-01) when this object was
2433-
* last modified
2434-
* @deprecated use getLastModifiedInstant instead
2435-
*/
2436-
@Deprecated
2437-
public long getLastModifiedTime() {
2438-
return lastModifiedInstant.toEpochMilli();
2439-
}
2440-
24412391
/**
24422392
* Get the time when this object was last modified
24432393
*

org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -770,24 +770,6 @@ static boolean isSymlink(File file) {
770770
return Files.isSymbolicLink(file.toPath());
771771
}
772772

773-
/**
774-
* Get the lastModified attribute for a given file
775-
*
776-
* @param file
777-
* the file
778-
* @return lastModified attribute for given file, not following symbolic
779-
* links
780-
* @throws IOException
781-
* if an IO error occurred
782-
* @deprecated use {@link #lastModifiedInstant(Path)} instead which returns
783-
* FileTime
784-
*/
785-
@Deprecated
786-
static long lastModified(File file) throws IOException {
787-
return Files.getLastModifiedTime(toPath(file), LinkOption.NOFOLLOW_LINKS)
788-
.toMillis();
789-
}
790-
791773
/**
792774
* Get last modified timestamp of a file
793775
*
@@ -827,21 +809,6 @@ static BasicFileAttributes fileAttributes(File file) throws IOException {
827809
return Files.readAttributes(file.toPath(), BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
828810
}
829811

830-
/**
831-
* Set the last modified time of a file system object.
832-
*
833-
* @param file
834-
* the file
835-
* @param time
836-
* last modified timestamp
837-
* @throws IOException
838-
* if an IO error occurred
839-
*/
840-
@Deprecated
841-
static void setLastModified(File file, long time) throws IOException {
842-
Files.setLastModifiedTime(toPath(file), FileTime.fromMillis(time));
843-
}
844-
845812
/**
846813
* Set the last modified time of a file system object.
847814
*

0 commit comments

Comments
 (0)