com.fernsroth.squashfs
Class SquashFSUtils

java.lang.Object
  extended by com.fernsroth.squashfs.SquashFSUtils

public final class SquashFSUtils
extends java.lang.Object

Author:
Joseph M. Ferner (Near Infinity Corporation)

Field Summary
static java.text.SimpleDateFormat ISO8601_FORMAT
          iso 8601 date formatter.
static java.text.SimpleDateFormat LINUX_DATE_FORMAT
          linux date format.
 
Method Summary
static java.util.Date getDateFromMTime(long mtime)
          gets a date from a mtime.
static int getModeFromString(java.lang.String value)
          gets the mode from a string.
static java.lang.String getModeString(BaseFile baseFile)
          gets the mode string.
static long getMTimeFromDate(java.util.Date dateMTime)
          gets the mtime from the date.
static int getPermissionsFromString(java.lang.String str)
          gets the permissions bit mask from a string.
static java.lang.String getPermissionsString(long permissions)
          gets the permissions.
static java.lang.String getRelativePath(java.io.File root, java.io.File file)
          gets the relative path of a file.
static void walk(Directory dir, WalkHandler handler)
          walks a squashfs directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINUX_DATE_FORMAT

public static final java.text.SimpleDateFormat LINUX_DATE_FORMAT
linux date format.


ISO8601_FORMAT

public static java.text.SimpleDateFormat ISO8601_FORMAT
iso 8601 date formatter.

Method Detail

getModeString

public static java.lang.String getModeString(BaseFile baseFile)
gets the mode string.

Parameters:
baseFile - the file to get the string from.
Returns:
the mode string.

getPermissionsString

public static java.lang.String getPermissionsString(long permissions)
gets the permissions.

Parameters:
permissions -
Returns:
the permissions string.

getModeFromString

public static int getModeFromString(java.lang.String value)
gets the mode from a string.

Parameters:
value - the value to convert.
Returns:
the mode.

getPermissionsFromString

public static int getPermissionsFromString(java.lang.String str)
gets the permissions bit mask from a string.

Parameters:
str - the string to get it from.
Returns:
the permissions bitmask.

getDateFromMTime

public static java.util.Date getDateFromMTime(long mtime)
gets a date from a mtime.

Parameters:
mtime - the mtime to convert.
Returns:
the date.

getMTimeFromDate

public static long getMTimeFromDate(java.util.Date dateMTime)
gets the mtime from the date.

Parameters:
dateMTime - the date to convert.
Returns:
the mtime.

walk

public static void walk(Directory dir,
                        WalkHandler handler)
                 throws java.lang.Exception
walks a squashfs directory.

Parameters:
dir - the directory to walk.
handler - the walk handler to get called for each entry.
Throws:
java.lang.Exception

getRelativePath

public static java.lang.String getRelativePath(java.io.File root,
                                               java.io.File file)
gets the relative path of a file.

Parameters:
root - the root path to get relative from.
file - the file to get the relative path of.
Returns:
the relative path of the file.


Copyright © 2006 null. All Rights Reserved.