Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.compress.archivers.zip
Class ZipUtil

    java.lang.Object
      org.apache.commons.compress.archivers.zip.ZipUtil

    public abstract class ZipUtil

extends Object

Utility class for handling DOS and Java time conversions.

This class is immutable

Constructor Summary
`ZipUtil()`

Method Summary
`static long` | `adjustToLong(int i)` Assumes a negative integer really is a positive integer that has wrapped around and re-creates the original value.
`static long` | `dosToJavaTime(long dosTime)` Converts DOS time to Java time (number of milliseconds since epoch).
`static Date` | `fromDosTime(ZipLong zipDosTime)` Convert a DOS date/time field to a Date object.
`static ZipLong` | `toDosTime(Date time)` Convert a Date object to a DOS date/time field.
`static byte[]` | `toDosTime(long t)` Convert a Date object to a DOS date/time field.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ZipUtil

    public ZipUtil()

Method Detail

### toDosTime

    public static ZipLong toDosTime(Date time)

  Convert a Date object to a DOS date/time field.

  Parameters:
    `time` - the `Date` to convert
  Returns:
    the date as a `ZipLong`

### toDosTime

    public static byte[] toDosTime(long t)

  Convert a Date object to a DOS date/time field.

  Stolen from InfoZip's `fileio.c`

  Parameters:
    `t` - number of milliseconds since the epoch
  Returns:
    the date as a byte array

### adjustToLong

    public static long adjustToLong(int i)

  Assumes a negative integer really is a positive integer that has wrapped around and re-creates the original value.

  Parameters:
    `i` - the value to treat as unsigned int.
  Returns:
    the unsigned int as a long.

### fromDosTime

    public static Date fromDosTime(ZipLong zipDosTime)

  Convert a DOS date/time field to a Date object.

  Parameters:
    `zipDosTime` - contains the stored DOS time.
  Returns:
    a Date instance corresponding to the given time.

### dosToJavaTime

    public static long dosToJavaTime(long dosTime)

  Converts DOS time to Java time (number of milliseconds since epoch).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 The Apache Software Foundation. All Rights Reserved.