|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.util.SecureAction
public class SecureAction
Utility class to execute common privileged code.
Method Summary | |
---|---|
static java.security.PrivilegedAction |
createSecureAction()
Creates a privileged action that can be used to construct a SecureAction object. |
java.lang.Thread |
createThread(java.lang.Runnable target,
java.lang.String name)
Creates a new Thread from a Runnable. |
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. |
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.Properties |
getProperties()
Returns the system properties. |
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.lang.Object |
getService(ServiceReference reference,
BundleContext context)
Gets a service object. |
java.net.URL |
getURL(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String file,
java.net.URLStreamHandler handler)
Gets a URL. |
java.util.zip.ZipFile |
getZipFile(java.io.File file)
Returns a ZipFile. |
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. |
java.lang.Class |
loadSystemClass(java.lang.String name)
Returns a Class. |
void |
open(ServiceTracker tracker)
Opens a ServiceTracker. |
void |
start(Bundle bundle)
Starts a bundle |
void |
start(Bundle bundle,
int options)
Starts a bundle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.security.PrivilegedAction createSecureAction()
SecureAction secureAction = (SecureAction) AccessController.doPrivileged(SecureAction.createSecureAction());
public 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 java.util.Properties getProperties()
public java.io.FileInputStream getFileInputStream(java.io.File file) throws java.io.FileNotFoundException
file
- the File to craete a FileInputStream from.
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 long length(java.io.File file)
file
- a file object
public boolean exists(java.io.File file)
file
- a file object
public boolean isDirectory(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 java.util.zip.ZipFile getZipFile(java.io.File file) throws java.io.IOException
file
- the file to get a ZipFile for
java.io.IOException
- if an error occuredpublic java.net.URL getURL(java.lang.String protocol, java.lang.String host, int port, java.lang.String file, java.net.URLStreamHandler handler) throws java.net.MalformedURLException
URL.URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler)
protocol
- the protocolhost
- the hostport
- the portfile
- the filehandler
- the URLStreamHandler
java.net.MalformedURLException
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.Object getService(ServiceReference reference, BundleContext context)
reference
- the ServiceReferencecontext
- the BundleContext
public java.lang.Class forName(java.lang.String name) throws java.lang.ClassNotFoundException
name
- the name of the class.
java.lang.ClassNotFoundException
public java.lang.Class loadSystemClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- the name of the class.
java.lang.ClassNotFoundException
public void open(ServiceTracker tracker)
tracker
- the ServiceTracker to open.public void start(Bundle bundle, int options) throws BundleException
bundle
- the bundle to startoptions
- the start options
BundleException
public void start(Bundle bundle) throws BundleException
bundle
-
BundleException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |