summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/org/trinitydesktop/koala/KFileShare.java
blob: 890114d68687a3409c780f758124d49f16c70c57 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

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

/**

 Common functionality for the file sharing
 (communication with the backend)
		@short    Common functionality for the file sharing  (communication with the backend)

*/
public class KFileShare implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;
	protected KFileShare(Class dummy){}

	public static final int NotInitialized = 0;
	public static final int ErrorNotFound = 1;
	public static final int Authorized = 2;
	public static final int UserNotAllowed = 3;

	/**
		 The used share mode.
		 Simple means that the simple sharing dialog is used and
		 users can share only folders from there HOME folder.
		 Advanced means that the advanced sharing dialog is used and
		 users can share any folder.
		     		@short    The used share mode.
	*/
	public static final int Simple = 0;
	public static final int Advanced = 1;

	public KFileShare() {
		newKFileShare();
	}
	private native void newKFileShare();
	/**
		 Reads the file share configuration file
		     		@short    Reads the file share configuration file
	*/
	public static native void readConfig();
	/**
		 Reads the list of shared folders
		     		@short    Reads the list of shared folders
	*/
	public static native void readShareList();
	/**
		 Call this to know if a directory is currently shared
		     		@short    Call this to know if a directory is currently shared
	*/
	public static native boolean isDirectoryShared(String path);
	/**
		 Call this to know if the current user is authorized to share directories
		     		@short    Call this to know if the current user is authorized to share directories
	*/
	public static native int authorization();
	public static native String findExe(String exeName);
	/**
		 Uses a suid perl script to share the given path
		 with NFS and Samba
			@param path the path to share
			@param shared whether the path should be shared or not
				@return whether the perl script was successful

		@short    Uses a suid perl script to share the given path   with NFS and Samba
	*/
	public static native boolean setShared(String path, boolean shared);
	/**
		 Returns whether sharing is enabled
		 If this is false, file sharing is disabled and
		 nobody can share files.
		     		@short    Returns whether sharing is enabled  If this is false, file sharing is disabled and  nobody can share files.
	*/
	public static native boolean sharingEnabled();
	/**
		 Returns whether file sharing is restricted.
		 If it is not restricted every user can shar files.
		 If it is restricted only users in the configured
		 file share group can share files.
		     		@short    Returns whether file sharing is restricted.
	*/
	public static native boolean isRestricted();
	/**
		 Returns the group that is used for file sharing.
		 That is, all users in that group are allowed to
		 share files if file sharing is restricted.
		     		@short    Returns the group that is used for file sharing.
	*/
	public static native String fileShareGroup();
	/**
		 Returns the configured share mode
		     		@short    Returns the configured share mode
	*/
	public static native int shareMode();
	/**
		 Returns whether Samba is enabled
		     		@short    Returns whether Samba is enabled
	*/
	public static native boolean sambaEnabled();
	/**
		 Returns whether NFS is enabled
		     		@short     Returns whether NFS is enabled
	*/
	public static native boolean nfsEnabled();
	/** 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();
}