Skip to content

Commit ae9920e

Browse files
committed
Javadoc
1 parent bda102e commit ae9920e

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

src/main/java/org/apache/commons/io/file/attribute/FileTimes.java

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,13 @@ public static FileTime now() {
141141

142142
/**
143143
* Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.
144+
* <p>
145+
* An NTFS file time is a 64-bit value for the number of 100-nanosecond intervals since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
146+
* </p>
144147
*
145-
* @param ntfsTime the NTFS time in 100 nanosecond units
146-
* @return the Date
148+
* @param ntfsTime the NTFS time, 100-nanosecond units since 1 January 1601.
149+
* @return the Date input.
150+
* @see <a href="https://learn.microsoft.com/en-us/windows/win32/sysinfo/file-times">NTFS File Times</a>
147151
*/
148152
public static Date ntfsTimeToDate(final long ntfsTime) {
149153
final long javaHundredNanos = Math.addExact(ntfsTime, WINDOWS_EPOCH_OFFSET);
@@ -153,10 +157,14 @@ public static Date ntfsTimeToDate(final long ntfsTime) {
153157

154158
/**
155159
* Converts NTFS time (100-nanosecond units since 1 January 1601) to a FileTime.
160+
* <p>
161+
* An NTFS file time is a 64-bit value for the number of 100-nanosecond intervals since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
162+
* </p>
156163
*
157-
* @param ntfsTime the NTFS time in 100-nanosecond units
158-
* @return the FileTime
164+
* @param ntfsTime the NTFS time, 100-nanosecond units since 1 January 1601.
165+
* @return the FileTime input.
159166
* @see #toNtfsTime(FileTime)
167+
* @see <a href="https://learn.microsoft.com/en-us/windows/win32/sysinfo/file-times">NTFS File Times</a>
160168
*/
161169
public static FileTime ntfsTimeToFileTime(final long ntfsTime) {
162170
final long javaHundredsNanos = Math.addExact(ntfsTime, WINDOWS_EPOCH_OFFSET);
@@ -234,9 +242,12 @@ public static FileTime toFileTime(final Date date) {
234242

235243
/**
236244
* Converts a {@link Date} to NTFS time.
245+
* <p>
246+
* An NTFS file time is a 64-bit value for the number of 100-nanosecond intervals since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
247+
* </p>
237248
*
238-
* @param date the Date
239-
* @return the NTFS time
249+
* @param date the Date input.
250+
* @return the NTFS time, 100-nanosecond units since 1 January 1601.
240251
*/
241252
public static long toNtfsTime(final Date date) {
242253
final long javaHundredNanos = date.getTime() * HUNDRED_NANOS_PER_MILLISECOND;
@@ -245,9 +256,12 @@ public static long toNtfsTime(final Date date) {
245256

246257
/**
247258
* Converts a {@link FileTime} to NTFS time (100-nanosecond units since 1 January 1601).
259+
* <p>
260+
* An NTFS file time is a 64-bit value for the number of 100-nanosecond intervals since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
261+
* </p>
248262
*
249-
* @param fileTime the FileTime
250-
* @return the NTFS time in 100-nanosecond units
263+
* @param fileTime the FileTime input.
264+
* @return the NTFS time, 100-nanosecond units since 1 January 1601.
251265
*/
252266
public static long toNtfsTime(final FileTime fileTime) {
253267
final Instant instant = fileTime.toInstant();
@@ -257,9 +271,12 @@ public static long toNtfsTime(final FileTime fileTime) {
257271

258272
/**
259273
* Converts Java time (milliseconds since Epoch) to NTFS time.
274+
* <p>
275+
* An NTFS file time is a 64-bit value for the number of 100-nanosecond intervals since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
276+
* </p>
260277
*
261278
* @param javaTime the Java time
262-
* @return the NTFS time
279+
* @return the NTFS time, 100-nanosecond units since 1 January 1601.
263280
* @since 2.16.0
264281
*/
265282
public static long toNtfsTime(final long javaTime) {

0 commit comments

Comments
 (0)