org.kde.koala
Class KFileShare

java.lang.Object
  extended by org.kde.koala.KFileShare
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KFileShare
extends java.lang.Object
implements org.kde.qt.QtSupport

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


Field Summary
static int Advanced
           
static int Authorized
           
static int ErrorNotFound
           
static int NotInitialized
           
static int Simple
          The used share mode.
static int UserNotAllowed
           
 
Constructor Summary
  KFileShare()
           
protected KFileShare(java.lang.Class dummy)
           
 
Method Summary
static int authorization()
          Call this to know if the current user is authorized to share directories
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
static java.lang.String fileShareGroup()
          Returns the group that is used for file sharing.
protected  void finalize()
          Deletes the wrapped C++ instance
static java.lang.String findExe(java.lang.String exeName)
           
static boolean isDirectoryShared(java.lang.String path)
          Call this to know if a directory is currently shared
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static boolean isRestricted()
          Returns whether file sharing is restricted.
static boolean nfsEnabled()
          Returns whether NFS is enabled
static void readConfig()
          Reads the file share configuration file
static void readShareList()
          Reads the list of shared folders
static boolean sambaEnabled()
          Returns whether Samba is enabled
static boolean setShared(java.lang.String path, boolean shared)
          Uses a suid perl script to share the given path with NFS and Samba
static int shareMode()
          Returns the configured share mode
static boolean sharingEnabled()
          Returns whether sharing is enabled If this is false, file sharing is disabled and nobody can share files.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NotInitialized

public static final int NotInitialized
See Also:
Constant Field Values

ErrorNotFound

public static final int ErrorNotFound
See Also:
Constant Field Values

Authorized

public static final int Authorized
See Also:
Constant Field Values

UserNotAllowed

public static final int UserNotAllowed
See Also:
Constant Field Values

Simple

public static final int Simple
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.

See Also:
Constant Field Values

Advanced

public static final int Advanced
See Also:
Constant Field Values
Constructor Detail

KFileShare

protected KFileShare(java.lang.Class dummy)

KFileShare

public KFileShare()
Method Detail

readConfig

public static void readConfig()
Reads the file share configuration file


readShareList

public static void readShareList()
Reads the list of shared folders


isDirectoryShared

public static boolean isDirectoryShared(java.lang.String path)
Call this to know if a directory is currently shared


authorization

public static int authorization()
Call this to know if the current user is authorized to share directories


findExe

public static java.lang.String findExe(java.lang.String exeName)

setShared

public static boolean setShared(java.lang.String path,
                                boolean shared)
Uses a suid perl script to share the given path with NFS and Samba

Parameters:
path - the path to share
shared - whether the path should be shared or not
Returns:
whether the perl script was successful

sharingEnabled

public static boolean sharingEnabled()
Returns whether sharing is enabled If this is false, file sharing is disabled and nobody can share files.


isRestricted

public static boolean isRestricted()
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.


fileShareGroup

public static java.lang.String fileShareGroup()
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.


shareMode

public static int shareMode()
Returns the configured share mode


sambaEnabled

public static boolean sambaEnabled()
Returns whether Samba is enabled


nfsEnabled

public static boolean nfsEnabled()
Returns whether NFS is enabled


finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

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


isDisposed

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