org.kde.koala

Class KArchiveFile

public class KArchiveFile extends KArchiveEntry

Represents a file entry in a KArchive.

See Also: KArchive KArchiveDirectory

UNKNOWN: A file in an archive.

Constructor Summary
protected KArchiveFile(Class dummy)
KArchiveFile(KArchive archive, String name, int access, int date, String user, String group, String symlink, int pos, int size)
Creates a new file entry.
Method Summary
voidcopyTo(String dest)
Extracts the file to the directory dest
byte[]data()
Returns the data of the file.
QIODeviceInterfacedevice()
This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisFile()
Checks whether this entry is a file.
intposition()
Position of the data in the [uncompressed] archive.
voidsetSize(int s)
Set size of data, usually after writing the file.
intsize()
Size of the data.

Constructor Detail

KArchiveFile

protected KArchiveFile(Class dummy)

KArchiveFile

public KArchiveFile(KArchive archive, String name, int access, int date, String user, String group, String symlink, int pos, int size)
Creates a new file entry.

Parameters: archive the entries archive name the name of the entry access the permissions in unix format date the date (in seconds since 1970) user the user that owns the entry group the group that owns the entry symlink the symlink, or null pos the position of the file in the directory size the size of the file

UNKNOWN: Creates a new file entry.

Method Detail

copyTo

public void copyTo(String dest)
Extracts the file to the directory dest

Parameters: dest the directory to extract to

UNKNOWN: Extracts the file to the directory dest

data

public byte[] data()
Returns the data of the file. Call data() with care (only once per file), this data isn't cached.

Returns: the content of this file.

UNKNOWN: Returns the data of the file.

device

public QIODeviceInterface device()
This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice. This is obviously for reading only. Note that the ownership of the device is being transferred to the caller, who will have to delete it. The returned device auto-opens (in readonly mode), no need to open it.

Returns: the QIODevice of the file

UNKNOWN: This method returns QIODevice (internal class: KLimitedIODevice) on top of the underlying QIODevice.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

isFile

public boolean isFile()
Checks whether this entry is a file.

Returns: true, since this entry is a file

UNKNOWN: Checks whether this entry is a file.

position

public int position()
Position of the data in the [uncompressed] archive.

Returns: the position of the file

UNKNOWN: Position of the data in the [uncompressed] archive.

setSize

public void setSize(int s)
Set size of data, usually after writing the file.

Parameters: s the new size of the file

UNKNOWN: Set size of data, usually after writing the file.

size

public int size()
Size of the data.

Returns: the size of the file

UNKNOWN: Size of the data.