TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.entry
Class DecoratingEntry<E extends Entry>

java.lang.Object
  extended by de.schlichtherle.truezip.entry.DecoratingEntry<E>
Type Parameters:
E - The type of the decorated entries.
All Implemented Interfaces:
Entry
Direct Known Subclasses:
FsArchiveController.ProxyEntry, IOCache.CacheEntry

@ThreadSafe
public abstract class DecoratingEntry<E extends Entry>
extends Object
implements Entry

An abstract decorator for an entry.

Author:
Christian Schlichtherle

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.schlichtherle.truezip.entry.Entry
Entry.Access, Entry.Size, Entry.Type
 
Field Summary
protected  E delegate
          The decorated entry.
 
Fields inherited from interface de.schlichtherle.truezip.entry.Entry
NULL, UNKNOWN
 
Constructor Summary
protected DecoratingEntry(E entry)
          Constructs a new decorating file system entry.
 
Method Summary
 String getName()
          Returns the entry name.
 long getSize(Entry.Size type)
          Returns the size of this entry.
 long getTime(Entry.Access type)
          Returns the last access time of this entry.
 Entry.Type getType()
          Returns the type of this entry or null if and only if this entry does not exist.
 String toString()
          Returns a string representation of this object for debugging and logging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

@NonNull
protected final E extends Entry delegate
The decorated entry.

Constructor Detail

DecoratingEntry

protected DecoratingEntry(@NonNull
                          E entry)
Constructs a new decorating file system entry.

Parameters:
entry - the decorated entry.
Method Detail

getName

public String getName()
Description copied from interface: Entry
Returns the entry name. When parsed, an entry name is interpreted as follows:
  1. An entry name is a sequence of segments which are separated by one or more separator characters (EntryName.SEPARATOR_CHAR). This implies that a segment cannot contain separator characters.
  2. An entry name may contain one or more dot (".") or dot-dot ("..") segments which represent the current or parent segment respectively.
  3. An entry name may start with one or more separator characters. In this case, its said to be absolute. Otherwise, its said to be relative.
  4. An entry name may end with one or more separator characters (e.g. to identify a directory entry).
For example, the entry names "foo/bar/" and "./abc/../foo/./def/./../bar/." both refer to the same entry when being parsed.

Specified by:
getName in interface Entry
Returns:
The entry name.
See Also:
EntryName.create(String)

getType

public Entry.Type getType()
Description copied from interface: Entry
Returns the type of this entry or null if and only if this entry does not exist.

Specified by:
getType in interface Entry
Returns:
The type of this entry or null if and only if this entry does not exist.

getSize

public long getSize(Entry.Size type)
Description copied from interface: Entry
Returns the size of this entry.

Specified by:
getSize in interface Entry
Returns:
The size of the given size type for this entry in bytes, or Entry.UNKNOWN if not specified or the type is unsupported. This method may not be meaningful for non-file entries.

getTime

public long getTime(Entry.Access type)
Description copied from interface: Entry
Returns the last access time of this entry.

Specified by:
getTime in interface Entry
Returns:
The last time of the given access type for this entry in milliseconds since the epoch or -1 if not specified or the type is unsupported.

toString

public String toString()
Returns a string representation of this object for debugging and logging purposes.

Overrides:
toString in class Object

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.