|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.security.SecurityUtil
public final class SecurityUtil
Utility class to execute common privileged code.
| Constructor Summary | |
|---|---|
SecurityUtil()
Constructs a new SecureAction object. |
|
| Method Summary | |
|---|---|
java.lang.Thread |
createThread(java.lang.Runnable target,
java.lang.String name)
Creates a new Thread from a Runnable. |
boolean |
delete(java.io.File file)
Deletes the specified file. |
java.lang.Object |
dispatchPrivileged(int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
|
java.lang.Object |
doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1)
Performs a privileged action using the current security context. |
java.lang.Object |
doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2)
Performs a privileged action using the current security context. |
java.lang.Object |
doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Performs a privileged action using the current security context. |
java.lang.Object |
doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Performs a privileged action using the current security context. |
boolean |
exists(java.io.File file)
Returns true if a file exists, otherwise false is returned. |
java.lang.Class |
forName(java.lang.String name)
Returns a Class. |
boolean |
getBooleanProperty(java.lang.String property)
Returns a boolean system property. |
java.io.FileInputStream |
getFileInputStream(java.io.File file)
Creates a FileInputStream from a File. |
java.io.FileOutputStream |
getFileOutputStream(java.io.File file,
boolean append)
Creates a FileInputStream from a File. |
java.util.Dictionary |
getHeaders(Bundle bundle)
Gets the bundle headers. |
java.lang.String |
getLocation(Bundle bundle)
Gets the location of the bundle. |
java.lang.String |
getProperty(java.lang.String property)
Returns a system property. |
java.lang.String |
getProperty(java.lang.String property,
java.lang.String def)
Returns a system property. |
java.io.RandomAccessFile |
getRandomAccessFile(java.io.File file,
java.lang.String mode)
Creates a random access file |
java.lang.Object |
getService(ServiceReference reference,
BundleContext context)
Gets a service object. |
ServiceReference[] |
getServiceReferences(java.lang.String clazz,
java.lang.String filter,
BundleContext context)
Gets a reference for the specified service(s). |
boolean |
isDirectory(java.io.File file)
Returns true if a file is a directory, otherwise false is returned. |
long |
lastModified(java.io.File file)
Returns a file's last modified stamp. |
long |
length(java.io.File file)
Returns the length of a file. |
java.lang.String[] |
list(java.io.File file)
Returns a file's list. |
ServiceRegistration |
registerService(java.lang.String[] classes,
java.lang.Object service,
java.util.Dictionary properties,
BundleContext context)
Registers a instance that implements many services. |
ServiceRegistration |
registerService(java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary properties,
BundleContext context)
Registers a service. |
boolean |
renameTo(java.io.File source,
java.io.File target)
Renames the source file to the target name. |
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Sets a system property. |
void |
start(Bundle bundle)
Starts the bundle. |
void |
stop(Bundle bundle)
Stops the bundle. |
void |
uninstall(Bundle bundle)
Un-installs the bundle. |
void |
update(Bundle bundle)
Updates the bundle. |
void |
update(Bundle bundle,
java.io.InputStream is)
Updates the bundle from stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SecurityUtil()
| Method Detail |
|---|
public java.lang.Thread createThread(java.lang.Runnable target,
java.lang.String name)
target - the Runnable to create the Thread from.name - The name of the Thread.
public java.lang.Class forName(java.lang.String name)
throws java.lang.ClassNotFoundException
name - the name of the class.
java.lang.ClassNotFoundExceptionpublic java.lang.String getProperty(java.lang.String property)
property - the property key.
public java.lang.String getProperty(java.lang.String property,
java.lang.String def)
property - the property key.def - the default value if the property key does not exist.
public boolean getBooleanProperty(java.lang.String property)
property - the property key.
false, if not set
public java.lang.String setProperty(java.lang.String key,
java.lang.String value)
key - the name of the propertyvalue - the value of the system property
public java.io.FileInputStream getFileInputStream(java.io.File file)
throws java.io.FileNotFoundException
file - the File to create a FileInputStream from.
java.io.FileNotFoundException - if the File does not exist.
public java.io.RandomAccessFile getRandomAccessFile(java.io.File file,
java.lang.String mode)
throws java.io.FileNotFoundException
file - the file objectmode - the open mode
java.io.FileNotFoundException - if the File does not exist
public java.io.FileOutputStream getFileOutputStream(java.io.File file,
boolean append)
throws java.io.FileNotFoundException
file - the File to create a FileOutputStream from.append - indicates if the OutputStream should append content.
java.io.FileNotFoundException - if the File does not exist.public boolean exists(java.io.File file)
file - a file object
public boolean isDirectory(java.io.File file)
file - a file object
public long length(java.io.File file)
file - a file object
public long lastModified(java.io.File file)
file - a file object
public java.lang.String[] list(java.io.File file)
file - a file object
public boolean delete(java.io.File file)
file - the file object
public boolean renameTo(java.io.File source,
java.io.File target)
source - the file object, that will be renamedtarget - the target file name
public java.lang.Object getService(ServiceReference reference,
BundleContext context)
reference - the ServiceReferencecontext - the BundleContext
public ServiceReference[] getServiceReferences(java.lang.String clazz,
java.lang.String filter,
BundleContext context)
throws InvalidSyntaxException
clazz - the name of the requested service classfilter - an LDAP filtercontext - the BundleContext
null
InvalidSyntaxException - if filter is not correct
public ServiceRegistration registerService(java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary properties,
BundleContext context)
clazz - the class name of the serviceservice - the service instanceproperties - the properties.context - the bundle context
public ServiceRegistration registerService(java.lang.String[] classes,
java.lang.Object service,
java.util.Dictionary properties,
BundleContext context)
classes - the class names of the serviceservice - the service instanceproperties - the properties.context - the bundle context
public java.lang.String getLocation(Bundle bundle)
bundle - the bundle
public java.util.Dictionary getHeaders(Bundle bundle)
bundle - the bundle
public void start(Bundle bundle)
throws BundleException
bundle - the bundle
BundleException
public void stop(Bundle bundle)
throws BundleException
bundle - the bundle
BundleException
public void uninstall(Bundle bundle)
throws BundleException
bundle - the bundle
BundleException
public void update(Bundle bundle)
throws BundleException
bundle - the bundle
BundleException
public void update(Bundle bundle,
java.io.InputStream is)
throws BundleException
bundle - the bundleis - the stream
BundleException
public java.lang.Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
throws java.lang.Exception
dispatcher - the dispatcher which should be calledtype - the type of the action - used in the dispatcherarg1 - a parameter received by the dispatcherarg2 - a parameter received by the dispatcherarg3 - a parameter received by the dispatcherarg4 - a parameter received by the dispatcher
java.lang.Exception - if the dispatcher failsPrivilegedRunner.doPrivileged(Object,
com.prosyst.util.security.PrivilegedRunner.PrivilegedDispatcher, int,
Object, Object, Object, Object)
public java.lang.Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
throws java.lang.Exception
dispatcher - the dispatcher which should be calledtype - the type of the action - used in the dispatcherarg1 - a parameter received by the dispatcherarg2 - a parameter received by the dispatcherarg3 - a parameter received by the dispatcher
java.lang.Exception - if the dispatcher failsPrivilegedRunner.doPrivileged(Object,
com.prosyst.util.security.PrivilegedRunner.PrivilegedDispatcher, int,
Object, Object, Object, Object)
public java.lang.Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1,
java.lang.Object arg2)
throws java.lang.Exception
dispatcher - the dispatcher which should be calledtype - the type of the action - used in the dispatcherarg1 - a parameter received by the dispatcherarg2 - a parameter received by the dispatcher
java.lang.Exception - if the dispatcher failsPrivilegedRunner.doPrivileged(Object,
com.prosyst.util.security.PrivilegedRunner.PrivilegedDispatcher, int,
Object, Object, Object, Object)
public java.lang.Object doPrivileged(PrivilegedRunner.PrivilegedDispatcher dispatcher,
int type,
java.lang.Object arg1)
throws java.lang.Exception
dispatcher - the dispatcher which should be calledtype - the type of the action - used in the dispatcherarg1 - a parameter received by the dispatcher
java.lang.Exception - if the dispatcher failsPrivilegedRunner.doPrivileged(Object,
com.prosyst.util.security.PrivilegedRunner.PrivilegedDispatcher, int,
Object, Object, Object, Object)
public java.lang.Object dispatchPrivileged(int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
throws java.lang.Exception
dispatchPrivileged in interface PrivilegedRunner.PrivilegedDispatchertype - the type of the actionarg1 - parameter 1 - depends on the action typearg2 - parameter 2 - depends on the action typearg3 - parameter 3 - depends on the action typearg4 - parameter 4 - depends on the action type
java.lang.Exception - on errorPrivilegedRunner.PrivilegedDispatcher.dispatchPrivileged(int,
java.lang.Object, java.lang.Object, java.lang.Object,
java.lang.Object)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||