This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push: new cf8887545 Reuse commons-io, don't duplicate class FileTimes (deprecated TimeUtils methods) cf8887545 is described below commit cf88875456e9f0230bb0dedb40a801cf8474d51b Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu Dec 21 23:23:56 2023 -0500 Reuse commons-io, don't duplicate class FileTimes (deprecated TimeUtils methods) --- src/changes/changes.xml | 1 + .../archivers/sevenz/SevenZArchiveEntry.java | 31 ++++----- .../archivers/sevenz/SevenZOutputFile.java | 8 +-- .../compress/archivers/tar/TarArchiveEntry.java | 6 +- .../commons/compress/archivers/zip/X000A_NTFS.java | 10 +-- .../apache/commons/compress/utils/TimeUtils.java | 76 ++++++++++++---------- .../archivers/zip/ZipArchiveEntryTest.java | 19 +++--- 7 files changed, 81 insertions(+), 70 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 7f566515c..e4f490ef6 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -57,6 +57,7 @@ The <action> type attribute can be add,update,fix,remove. <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class Charsets (deprecated class).</action> <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class IOUtils (deprecated methods).</action> <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class BoundedInputStream (deprecated class).</action> + <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse commons-io, don't duplicate class FileTimes (deprecated TimeUtils methods).</action> <action type="fix" dev="ggregory" due-to="Gary Gregory">Reuse Arrays.equals(byte[], byte[]) and deprecate ArchiveUtils.isEqual(byte[], byte[]).</action> <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check for the class loader of OsgiUtils #451.</action> <action type="fix" dev="ggregory" due-to="alumi, Gary Gregory">Add a null-check in Pack200.newInstance(String, String).</action> diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java index a2dc51b95..95ad18733 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntry.java @@ -26,6 +26,7 @@ import java.util.Objects; import org.apache.commons.compress.archivers.ArchiveEntry; import org.apache.commons.compress.utils.TimeUtils; +import org.apache.commons.io.file.attribute.FileTimes; /** * An entry in a 7z archive. @@ -42,12 +43,12 @@ public class SevenZArchiveEntry implements ArchiveEntry { * * @param date the Java time * @return the NTFS time - * @deprecated Use {@link TimeUtils#toNtfsTime(Date)} instead. - * @see TimeUtils#toNtfsTime(Date) + * @deprecated Use {@link FileTimes#toNtfsTime(Date)} instead. + * @see FileTimes#toNtfsTime(Date) */ @Deprecated public static long javaTimeToNtfsTime(final Date date) { - return TimeUtils.toNtfsTime(date); + return FileTimes.toNtfsTime(date); } /** @@ -55,12 +56,12 @@ public class SevenZArchiveEntry implements ArchiveEntry { * * @param ntfsTime the NTFS time in 100 nanosecond units * @return the Java time - * @deprecated Use {@link TimeUtils#ntfsTimeToDate(long)} instead. - * @see TimeUtils#ntfsTimeToDate(long) + * @deprecated Use {@link FileTimes#ntfsTimeToDate(long)} instead. + * @see FileTimes#ntfsTimeToDate(long) */ @Deprecated public static Date ntfsTimeToJavaTime(final long ntfsTime) { - return TimeUtils.ntfsTimeToDate(ntfsTime); + return FileTimes.ntfsTimeToDate(ntfsTime); } private String name; @@ -132,7 +133,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @see SevenZArchiveEntry#getAccessTime() */ public Date getAccessDate() { - return TimeUtils.toDate(getAccessTime()); + return FileTimes.toDate(getAccessTime()); } /** @@ -227,7 +228,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @see SevenZArchiveEntry#getCreationTime() */ public Date getCreationDate() { - return TimeUtils.toDate(getCreationTime()); + return FileTimes.toDate(getCreationTime()); } /** @@ -302,7 +303,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { */ @Override public Date getLastModifiedDate() { - return TimeUtils.toDate(getLastModifiedTime()); + return FileTimes.toDate(getLastModifiedTime()); } /** @@ -393,7 +394,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @see SevenZArchiveEntry#setAccessTime(FileTime) */ public void setAccessDate(final Date accessDate) { - setAccessTime(TimeUtils.toFileTime(accessDate)); + setAccessTime(FileTimes.toFileTime(accessDate)); } /** @@ -402,7 +403,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @param ntfsAccessDate the access date */ public void setAccessDate(final long ntfsAccessDate) { - this.accessDate = TimeUtils.ntfsTimeToFileTime(ntfsAccessDate); + this.accessDate = FileTimes.ntfsTimeToFileTime(ntfsAccessDate); } /** @@ -529,7 +530,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @see SevenZArchiveEntry#setCreationTime(FileTime) */ public void setCreationDate(final Date creationDate) { - setCreationTime(TimeUtils.toFileTime(creationDate)); + setCreationTime(FileTimes.toFileTime(creationDate)); } /** @@ -538,7 +539,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @param ntfsCreationDate the creation date */ public void setCreationDate(final long ntfsCreationDate) { - this.creationDate = TimeUtils.ntfsTimeToFileTime(ntfsCreationDate); + this.creationDate = FileTimes.ntfsTimeToFileTime(ntfsCreationDate); } /** @@ -624,7 +625,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @see SevenZArchiveEntry#setLastModifiedTime(FileTime) */ public void setLastModifiedDate(final Date lastModifiedDate) { - setLastModifiedTime(TimeUtils.toFileTime(lastModifiedDate)); + setLastModifiedTime(FileTimes.toFileTime(lastModifiedDate)); } /** @@ -633,7 +634,7 @@ public class SevenZArchiveEntry implements ArchiveEntry { * @param ntfsLastModifiedDate the last modified date */ public void setLastModifiedDate(final long ntfsLastModifiedDate) { - this.lastModifiedDate = TimeUtils.ntfsTimeToFileTime(ntfsLastModifiedDate); + this.lastModifiedDate = FileTimes.ntfsTimeToFileTime(ntfsLastModifiedDate); } /** diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java index 3818d297f..66c2ad3a8 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java @@ -52,7 +52,7 @@ import java.util.stream.StreamSupport; import java.util.zip.CRC32; import org.apache.commons.compress.archivers.ArchiveEntry; -import org.apache.commons.compress.utils.TimeUtils; +import org.apache.commons.io.file.attribute.FileTimes; import org.apache.commons.io.output.CountingOutputStream; /** @@ -585,7 +585,7 @@ public class SevenZOutputFile implements Closeable { out.write(0); for (final SevenZArchiveEntry entry : files) { if (entry.getHasAccessDate()) { - final long ntfsTime = TimeUtils.toNtfsTime(entry.getAccessTime()); + final long ntfsTime = FileTimes.toNtfsTime(entry.getAccessTime()); out.writeLong(Long.reverseBytes(ntfsTime)); } } @@ -621,7 +621,7 @@ public class SevenZOutputFile implements Closeable { out.write(0); for (final SevenZArchiveEntry entry : files) { if (entry.getHasCreationDate()) { - final long ntfsTime = TimeUtils.toNtfsTime(entry.getCreationTime()); + final long ntfsTime = FileTimes.toNtfsTime(entry.getCreationTime()); out.writeLong(Long.reverseBytes(ntfsTime)); } } @@ -698,7 +698,7 @@ public class SevenZOutputFile implements Closeable { out.write(0); for (final SevenZArchiveEntry entry : files) { if (entry.getHasLastModifiedDate()) { - final long ntfsTime = TimeUtils.toNtfsTime(entry.getLastModifiedTime()); + final long ntfsTime = FileTimes.toNtfsTime(entry.getLastModifiedTime()); out.writeLong(Long.reverseBytes(ntfsTime)); } } diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java index 2884eb2c3..84881f118 100644 --- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java @@ -52,6 +52,7 @@ import org.apache.commons.compress.utils.ArchiveUtils; import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.compress.utils.ParsingUtils; import org.apache.commons.compress.utils.TimeUtils; +import org.apache.commons.io.file.attribute.FileTimes; /** * This class represents an entry in a Tar archive. It consists of the entry's header, as well as the entry's File. Entries can be instantiated in one of three @@ -997,7 +998,8 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants, EntryStreamO * @see TarArchiveEntry#getLastModifiedTime() */ public Date getModTime() { - return TimeUtils.toDate(mTime); + final FileTime fileTime = mTime; + return FileTimes.toDate(fileTime); } /** @@ -1877,7 +1879,7 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants, EntryStreamO * @see TarArchiveEntry#setLastModifiedTime(FileTime) */ public void setModTime(final Date time) { - setLastModifiedTime(TimeUtils.toFileTime(time)); + setLastModifiedTime(FileTimes.toFileTime(time)); } /** diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java b/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java index 3e32a4d16..36d844a17 100644 --- a/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java +++ b/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java @@ -21,7 +21,7 @@ import java.util.Date; import java.util.Objects; import java.util.zip.ZipException; -import org.apache.commons.compress.utils.TimeUtils; +import org.apache.commons.io.file.attribute.FileTimes; /** * NTFS extra field that was thought to store various attributes but in reality only stores timestamps. @@ -81,28 +81,28 @@ public class X000A_NTFS implements ZipExtraField { if (d == null) { return null; } - return new ZipEightByteInteger(TimeUtils.toNtfsTime(d)); + return new ZipEightByteInteger(FileTimes.toNtfsTime(d)); } private static ZipEightByteInteger fileTimeToZip(final FileTime time) { if (time == null) { return null; } - return new ZipEightByteInteger(TimeUtils.toNtfsTime(time)); + return new ZipEightByteInteger(FileTimes.toNtfsTime(time)); } private static Date zipToDate(final ZipEightByteInteger z) { if (z == null || ZipEightByteInteger.ZERO.equals(z)) { return null; } - return TimeUtils.ntfsTimeToDate(z.getLongValue()); + return FileTimes.ntfsTimeToDate(z.getLongValue()); } private static FileTime zipToFileTime(final ZipEightByteInteger z) { if (z == null || ZipEightByteInteger.ZERO.equals(z)) { return null; } - return TimeUtils.ntfsTimeToFileTime(z.getLongValue()); + return FileTimes.ntfsTimeToFileTime(z.getLongValue()); } private ZipEightByteInteger modifyTime = ZipEightByteInteger.ZERO; diff --git a/src/main/java/org/apache/commons/compress/utils/TimeUtils.java b/src/main/java/org/apache/commons/compress/utils/TimeUtils.java index 160f9ad56..c7551147d 100644 --- a/src/main/java/org/apache/commons/compress/utils/TimeUtils.java +++ b/src/main/java/org/apache/commons/compress/utils/TimeUtils.java @@ -21,6 +21,8 @@ import java.time.Instant; import java.util.Date; import java.util.concurrent.TimeUnit; +import org.apache.commons.io.file.attribute.FileTimes; + /** * Utility class for handling time-related types and conversions. * <p> @@ -59,8 +61,8 @@ public final class TimeUtils { * TODO ? If the FileTime is null, this method always returns true. * </p> * - * @param time the FileTime to evaluate, can be null - * @return true if the time exceeds the minimum or maximum UNIX time, false otherwise + * @param time the FileTime to evaluate, can be null. + * @return true if the time exceeds the minimum or maximum UNIX time, false otherwise. */ public static boolean isUnixTime(final FileTime time) { return time == null ? true : isUnixTime(toUnixTime(time)); @@ -69,8 +71,8 @@ public final class TimeUtils { /** * Tests whether a given number of seconds (since Epoch) can be safely represented in the standard UNIX time. * - * @param seconds the number of seconds (since Epoch) to evaluate - * @return true if the time can be represented in the standard UNIX time, false otherwise + * @param seconds the number of seconds (since Epoch) to evaluate. + * @return true if the time can be represented in the standard UNIX time, false otherwise. */ public static boolean isUnixTime(final long seconds) { return Integer.MIN_VALUE <= seconds && seconds <= Integer.MAX_VALUE; @@ -79,29 +81,27 @@ public final class TimeUtils { /** * Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time. * - * @param ntfsTime the NTFS time in 100 nanosecond units - * @return the Date + * @param ntfsTime the NTFS time in 100 nanosecond units. + * @return the Date. + * @deprecated Use {@link FileTimes#ntfsTimeToDate(long)}. */ + @Deprecated public static Date ntfsTimeToDate(final long ntfsTime) { - final long javaHundredNanos = Math.addExact(ntfsTime, WINDOWS_EPOCH_OFFSET); - final long javaMillis = Math.floorDiv(javaHundredNanos, HUNDRED_NANOS_PER_MILLISECOND); - return new Date(javaMillis); + return FileTimes.ntfsTimeToDate(ntfsTime); } /** * Converts NTFS time (100-nanosecond units since 1 January 1601) to a FileTime. * - * @param ntfsTime the NTFS time in 100-nanosecond units - * @return the FileTime - * + * @param ntfsTime the NTFS time in 100-nanosecond units. + * @return the FileTime. * @see TimeUtils#WINDOWS_EPOCH_OFFSET * @see TimeUtils#toNtfsTime(FileTime) + * @deprecated Use {@link FileTimes#ntfsTimeToFileTime(long)}. */ + @Deprecated public static FileTime ntfsTimeToFileTime(final long ntfsTime) { - final long javaHundredsNanos = Math.addExact(ntfsTime, WINDOWS_EPOCH_OFFSET); - final long javaSeconds = Math.floorDiv(javaHundredsNanos, HUNDRED_NANOS_PER_SECOND); - final long javaNanos = Math.floorMod(javaHundredsNanos, HUNDRED_NANOS_PER_SECOND) * 100; - return FileTime.from(Instant.ofEpochSecond(javaSeconds, javaNanos)); + return FileTimes.ntfsTimeToFileTime(ntfsTime); } /** @@ -110,9 +110,11 @@ public final class TimeUtils { * @param fileTime the file time to be converted. * @return a {@link Date} which corresponds to the supplied time, or {@code null} if the time is {@code null}. * @see TimeUtils#toFileTime(Date) + * @deprecated Use {@link FileTimes#toDate(FileTime)}. */ + @Deprecated public static Date toDate(final FileTime fileTime) { - return fileTime != null ? new Date(fileTime.toMillis()) : null; + return FileTimes.toDate(fileTime); } /** @@ -121,43 +123,47 @@ public final class TimeUtils { * @param date the date to be converted. * @return a {@link FileTime} which corresponds to the supplied date, or {@code null} if the date is {@code null}. * @see TimeUtils#toDate(FileTime) + * @deprecated Use {@link FileTimes#toFileTime(Date)}. */ + @Deprecated public static FileTime toFileTime(final Date date) { - return date != null ? FileTime.fromMillis(date.getTime()) : null; + return FileTimes.toFileTime(date); } /** * Converts a {@link Date} to NTFS time. * - * @param date the Date - * @return the NTFS time + * @param date the Date. + * @return the NTFS time. + * @deprecated Use {@link FileTimes#toNtfsTime(Date)}. */ + @Deprecated public static long toNtfsTime(final Date date) { - return toNtfsTime(date.getTime()); + return FileTimes.toNtfsTime(date); } /** * Converts a {@link FileTime} to NTFS time (100-nanosecond units since 1 January 1601). * - * @param fileTime the FileTime - * @return the NTFS time in 100-nanosecond units - * + * @param fileTime the FileTime. + * @return the NTFS time in 100-nanosecond units. * @see TimeUtils#WINDOWS_EPOCH_OFFSET * @see TimeUtils#ntfsTimeToFileTime(long) + * @deprecated Use {@link FileTimes#toNtfsTime(FileTime)}. */ + @Deprecated public static long toNtfsTime(final FileTime fileTime) { - final Instant instant = fileTime.toInstant(); - final long javaHundredNanos = instant.getEpochSecond() * HUNDRED_NANOS_PER_SECOND + instant.getNano() / 100; - return Math.subtractExact(javaHundredNanos, WINDOWS_EPOCH_OFFSET); + return FileTimes.toNtfsTime(fileTime); } /** * Converts Java time (milliseconds since Epoch) to NTFS time. * - * @param javaTime the Java time - * @return the NTFS time + * @param javaTime the Java time. + * @return the NTFS time. */ public static long toNtfsTime(final long javaTime) { + // TODO Apache Commons IO 2.16.0 final long javaHundredNanos = javaTime * HUNDRED_NANOS_PER_MILLISECOND; return Math.subtractExact(javaHundredNanos, WINDOWS_EPOCH_OFFSET); } @@ -165,8 +171,8 @@ public final class TimeUtils { /** * Converts {@link FileTime} to standard UNIX time. * - * @param fileTime the original FileTime - * @return the UNIX timestamp + * @param fileTime the original FileTime. + * @return the UNIX timestamp. */ public static long toUnixTime(final FileTime fileTime) { return fileTime.to(TimeUnit.SECONDS); @@ -175,8 +181,8 @@ public final class TimeUtils { /** * Truncates a FileTime to 100-nanosecond precision. * - * @param fileTime the FileTime to be truncated - * @return the truncated FileTime + * @param fileTime the FileTime to be truncated. + * @return the truncated FileTime. */ public static FileTime truncateToHundredNanos(final FileTime fileTime) { final Instant instant = fileTime.toInstant(); @@ -186,8 +192,8 @@ public final class TimeUtils { /** * Converts standard UNIX time (in seconds, UTC/GMT) to {@link FileTime}. * - * @param time UNIX timestamp - * @return the corresponding FileTime + * @param time UNIX timestamp. + * @return the corresponding FileTime. */ public static FileTime unixTimeToFileTime(final long time) { return FileTime.from(time, TimeUnit.SECONDS); diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java index 650dfaaa8..1fbca4a70 100644 --- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java @@ -36,6 +36,7 @@ import java.util.zip.ZipException; import org.apache.commons.compress.utils.ByteUtils; import org.apache.commons.compress.utils.TimeUtils; +import org.apache.commons.io.file.attribute.FileTimes; import org.junit.jupiter.api.Test; /** @@ -348,8 +349,8 @@ public class ZipArchiveEntryTest { final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(accessTime), ntfs.getAccessTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(accessTime), ntfs.getAccessTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); } @Test @@ -363,7 +364,7 @@ public class ZipArchiveEntryTest { assertNull(ze.getExtraField(X5455_ExtendedTimestamp.HEADER_ID)); final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); - assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); assertEquals(0L, ntfs.getAccessTime().getLongValue()); assertEquals(0L, ntfs.getCreateTime().getLongValue()); } @@ -385,7 +386,7 @@ public class ZipArchiveEntryTest { final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(lastAccessTime), ntfs.getAccessTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(lastAccessTime), ntfs.getAccessTime().getLongValue()); assertEquals(0L, ntfs.getCreateTime().getLongValue()); } @@ -408,8 +409,8 @@ public class ZipArchiveEntryTest { final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(accessTime), ntfs.getAccessTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(accessTime), ntfs.getAccessTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); } @Test @@ -430,7 +431,7 @@ public class ZipArchiveEntryTest { assertNotNull(ntfs); assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); assertEquals(0L, ntfs.getAccessTime().getLongValue()); - assertEquals(TimeUtils.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(creationTime), ntfs.getCreateTime().getLongValue()); } @Test @@ -448,7 +449,7 @@ public class ZipArchiveEntryTest { assertNull(extendedTimestamp.getCreateTime()); final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); - assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); assertEquals(0L, ntfs.getAccessTime().getLongValue()); assertEquals(0L, ntfs.getCreateTime().getLongValue()); } @@ -468,7 +469,7 @@ public class ZipArchiveEntryTest { assertNull(extendedTimestamp.getCreateTime()); final X000A_NTFS ntfs = (X000A_NTFS) ze.getExtraField(X000A_NTFS.HEADER_ID); assertNotNull(ntfs); - assertEquals(TimeUtils.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); + assertEquals(FileTimes.toNtfsTime(time), ntfs.getModifyTime().getLongValue()); assertEquals(0L, ntfs.getAccessTime().getLongValue()); assertEquals(0L, ntfs.getCreateTime().getLongValue()); }