|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.file.SimpleFileAttributes
com.mucommander.file.ArchiveEntry
public class ArchiveEntry
This class represents a generic archive entry. It provides getters and setters for common archive entry attributes and allows to encapsulate the entry object of a 3rd party library.
Important: the path of archive entries must use the '/' character as a path delimiter, and be relative to the archive's root, i.e. must not start with a leading '/'.
| Field Summary | |
|---|---|
protected java.lang.Object |
entryObject
Encapsulated entry object |
| Constructor Summary | |
|---|---|
ArchiveEntry()
Creates a new ArchiveEntry with all attributes set to their default value. |
|
ArchiveEntry(java.lang.String path,
boolean directory)
Creates a new ArchiveEntry using the supplied path and directory attributes. |
|
ArchiveEntry(java.lang.String path,
boolean directory,
long date,
long size)
Creates a new ArchiveEntry using the values of the supplied attributes. |
|
| Method Summary | |
|---|---|
int |
getDepth()
Returns the depth of this entry based on the number of path delimiters ('/') its path contains. |
static int |
getDepth(java.lang.String entryPath)
Returns the depth of the specified entry path, based on the number of path delimiters ('/') it contains. |
java.lang.Object |
getEntryObject()
Returns an archive format-dependent object providing extra information about this entry, typically an object from a 3rd party library ; null if this entry has none. |
java.lang.String |
getName()
Extracts this entry's filename from its path and returns it. |
FilePermissions |
getPermissions()
Returns the file permissions of this entry. |
void |
setEntryObject(java.lang.Object entryObject)
Sets an archive format-dependent object providing extra information about this entry, typically an object from a 3rd party library ; null for none. |
| Methods inherited from class com.mucommander.file.SimpleFileAttributes |
|---|
getDate, getExists, getGroup, getOwner, getPath, getSize, isDirectory, setDate, setDirectory, setExists, setGroup, setOwner, setPath, setPermissions, setSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object entryObject
| Constructor Detail |
|---|
public ArchiveEntry()
public ArchiveEntry(java.lang.String path,
boolean directory)
path - the entry's pathdirectory - true if the entry is a directory
public ArchiveEntry(java.lang.String path,
boolean directory,
long date,
long size)
path - the entry's pathdirectory - true if the entry is a directorydate - the entry's datesize - the entry's size| Method Detail |
|---|
public int getDepth()
public static int getDepth(java.lang.String entryPath)
entryPath - the path for which to calculate the depth
public java.lang.String getName()
public java.lang.Object getEntryObject()
null if this entry has none.
public void setEntryObject(java.lang.Object entryObject)
null for none.
entryObject - an object providing extra information about this entry, null for nonepublic FilePermissions getPermissions()
FilePermissions.DEFAULT_DIRECTORY_PERMISSIONS for directories, FilePermissions.DEFAULT_FILE_PERMISSIONS
for regular files), when none have been set.
getPermissions in interface FileAttributesgetPermissions in class SimpleFileAttributes
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard