summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/org/trinitydesktop/koala/KArchiveFile.java
blob: 03ef24a3e14aeb96eb965d11f4791bcbcb400a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQIODevice;
import org.trinitydesktop.qt.TQIODeviceInterface;

/**

 Represents a file entry in a KArchive.
		@short A file in an archive.
		@see KArchive
		@see KArchiveDirectory

*/
public class KArchiveFile extends KArchiveEntry  {
	protected KArchiveFile(Class dummy){super((Class) null);}
	/**
		 Creates a new file entry.
			@param archive the entries archive
			@param name the name of the entry
			@param access the permissions in unix format
			@param date the date (in seconds since 1970)
			@param user the user that owns the entry
			@param group the group that owns the entry
			@param symlink the symlink, or null
			@param pos the position of the file in the directory
			@param size the size of the file
		     		@short    Creates a new file entry.
	*/
	public KArchiveFile(KArchive archive, String name, int access, int date, String user, String group, String symlink, int pos, int size) {
		super((Class) null);
		newKArchiveFile(archive,name,access,date,user,group,symlink,pos,size);
	}
	private native void newKArchiveFile(KArchive archive, String name, int access, int date, String user, String group, String symlink, int pos, int size);
	/**
		 Position of the data in the [uncompressed] archive.
				@return the position of the file

		@short    Position of the data in the [uncompressed] archive.
	*/
	public native int position();
	/**
		 Size of the data.
				@return the size of the file

		@short    Size of the data.
	*/
	public native int size();
	/**
		 Set size of data, usually after writing the file.
			@param s the new size of the file
		     		@short    Set size of data, usually after writing the file.
	*/
	public native void setSize(int s);
	/**
		 Returns the data of the file.
		 Call data() with care (only once per file), this data isn't cached.
				@return the content of this file.

		@short    Returns the data of the file.
	*/
	public native byte[] data();
	/**
		 This method returns TQIODevice (internal class: KLimitedIODevice)
		 on top of the underlying TQIODevice. 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.
				@return the TQIODevice of the file

		@short    This method returns TQIODevice (internal class: KLimitedIODevice)  on top of the underlying TQIODevice.
	*/
	public native TQIODeviceInterface device();
	/**
		 Checks whether this entry is a file.
				@return true, since this entry is a file

		@short    Checks whether this entry is a file.
	*/
	public native boolean isFile();
	/**
		 Extracts the file to the directory <code>dest</code>
			@param dest the directory to extract to
				@short    Extracts the file to the directory <code>dest</code>
	*/
	public native void copyTo(String dest);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}