Modifier and Type | Field and Description |
---|---|
static FileTime |
EPOCH
Constant for the
1970-01-01T00:00:00Z epoch as a time stamp attribute. |
Modifier and Type | Method and Description |
---|---|
static FileTime |
minusMillis(FileTime fileTime,
long millisToSubtract)
Subtracts milliseconds from a source FileTime.
|
static FileTime |
minusNanos(FileTime fileTime,
long nanosToSubtract)
Subtracts nanoseconds from a source FileTime.
|
static FileTime |
minusSeconds(FileTime fileTime,
long secondsToSubtract)
Subtracts seconds from a source FileTime.
|
static FileTime |
now()
Obtains the current instant FileTime from the system clock.
|
static Date |
ntfsTimeToDate(long ntfsTime)
Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.
|
static FileTime |
ntfsTimeToFileTime(long ntfsTime)
Converts NTFS time (100-nanosecond units since 1 January 1601) to a FileTime.
|
static FileTime |
plusMillis(FileTime fileTime,
long millisToAdd)
Adds milliseconds to a source FileTime.
|
static FileTime |
plusNanos(FileTime fileTime,
long nanosToSubtract)
Adds nanoseconds from a source FileTime.
|
static FileTime |
plusSeconds(FileTime fileTime,
long secondsToAdd)
Adds seconds to a source FileTime.
|
static void |
setLastModifiedTime(Path path)
Sets the last modified time of the given file path to now.
|
static Date |
toDate(FileTime fileTime)
|
static FileTime |
toFileTime(Date date)
|
static long |
toNtfsTime(Date date)
Converts a
Date to NTFS time. |
static long |
toNtfsTime(FileTime fileTime)
Converts a
FileTime to NTFS time (100-nanosecond units since 1 January 1601). |
public static final FileTime EPOCH
1970-01-01T00:00:00Z
epoch
as a time stamp attribute.Instant.EPOCH
public static FileTime minusMillis(FileTime fileTime, long millisToSubtract)
fileTime
- The source FileTime.millisToSubtract
- The milliseconds to subtract.public static FileTime minusNanos(FileTime fileTime, long nanosToSubtract)
fileTime
- The source FileTime.nanosToSubtract
- The nanoseconds to subtract.public static FileTime minusSeconds(FileTime fileTime, long secondsToSubtract)
fileTime
- The source FileTime.secondsToSubtract
- The seconds to subtract.public static FileTime now()
public static Date ntfsTimeToDate(long ntfsTime)
ntfsTime
- the NTFS time in 100 nanosecond unitspublic static FileTime ntfsTimeToFileTime(long ntfsTime)
ntfsTime
- the NTFS time in 100-nanosecond unitstoNtfsTime(FileTime)
public static FileTime plusMillis(FileTime fileTime, long millisToAdd)
fileTime
- The source FileTime.millisToAdd
- The milliseconds to add.public static FileTime plusNanos(FileTime fileTime, long nanosToSubtract)
fileTime
- The source FileTime.nanosToSubtract
- The nanoseconds to subtract.public static FileTime plusSeconds(FileTime fileTime, long secondsToAdd)
fileTime
- The source FileTime.secondsToAdd
- The seconds to add.public static void setLastModifiedTime(Path path) throws IOException
path
- The file path to set.IOException
- if an I/O error occurs.public static Date toDate(FileTime fileTime)
fileTime
- the file time to be converted.Date
which corresponds to the supplied time, or null
if the time is null
.toFileTime(Date)
public static FileTime toFileTime(Date date)
date
- the date to be converted.FileTime
which corresponds to the supplied date, or null
if the date is null
.toDate(FileTime)
public static long toNtfsTime(Date date)
Date
to NTFS time.date
- the Datepublic static long toNtfsTime(FileTime fileTime)
FileTime
to NTFS time (100-nanosecond units since 1 January 1601).fileTime
- the FileTimeCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.