TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.entry
Interface Entry

All Known Subinterfaces:
FsArchiveEntry, InputEntry<E>, IOEntry<E>, IOPool.Entry<E>, OutputEntry<E>
All Known Implementing Classes:
ByteArrayIOEntry, ByteArrayIOPool.Entry, DecoratingEntry, FsArchiveController.ProxyEntry, FsArchiveFileSystemEntry, FsArchiveFileSystemEntry.DirectoryEntry, FsArchiveFileSystemEntry.FileEntry, FsArchiveFileSystemEntry.NamedDirectoryEntry, FsArchiveFileSystemEntry.NamedFileEntry, FsArchiveFileSystemEntry.NamedSpecialFileEntry, FsCachingController.ProxyFileSystemEntry, FsDecoratingEntry, FsEntry, IOCache.CacheEntry

public interface Entry

Represents an entry in an entry container, e.g. an archive file or a file system etc.

In general, if a property has an unknown value, its getter method must return the value UNKNOWN or null respectively.

Author:
Christian Schlichtherle

Nested Class Summary
static class Entry.Access
          Defines the types of access information for an entry.
static class Entry.Size
          Defines the types of size information for an entry.
static class Entry.Type
          Defines the type of archive entry.
 
Field Summary
static Entry NULL
          The NULL entry is a dummy entry which may be useful in situations where a non-null entry is expected but none is available.
static byte UNKNOWN
          The unknown value for numeric properties, which is -1.
 
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.
 

Field Detail

NULL

static final Entry NULL
The NULL entry is a dummy entry which may be useful in situations where a non-null entry is expected but none is available.

The NULL entry has "/dev/random" as its name, NULL as its type and UNKNOWN for any other property.


UNKNOWN

static final byte UNKNOWN
The unknown value for numeric properties, which is -1.

See Also:
Constant Field Values
Method Detail

getName

@NonNull
String getName()
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.

Returns:
The entry name.
See Also:
EntryName.create(java.lang.String, java.lang.String)

getType

@Nullable
Entry.Type getType()
Returns the type of this entry or null if and only if this entry does not exist.

Returns:
The type of this entry or null if and only if this entry does not exist.

getSize

long getSize(@NonNull
             Entry.Size type)
Returns the size of this entry.

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

getTime

long getTime(@NonNull
             Entry.Access type)
Returns the last access time of this 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.

TrueZIP Kernel 7.0-rc1

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