|
||||||||||
| 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 PrivilegedAction<SecureAction> |
createSecureAction()
Creates a privileged action that can be used to construct a SecureAction object. |
|
Thread |
createThread(Runnable target,
String name,
ClassLoader contextLoader)
Creates a new Thread from a Runnable. |
|
boolean |
exists(File file)
Returns true if a file exists, otherwise false is returned. |
|
Class<?> |
forName(String name)
Returns a Class. |
|
String |
getCanonicalPath(File file)
Returns the canonical path of a file. |
|
FileInputStream |
getFileInputStream(File file)
Creates a FileInputStream from a File. |
|
FileOutputStream |
getFileOutputStream(File file,
boolean append)
Creates a FileInputStream from a File. |
|
Properties |
getProperties()
Returns the system properties. |
|
String |
getProperty(String property)
Returns a system property. |
|
String |
getProperty(String property,
String def)
Returns a system property. |
|
|
getService(ServiceReference<S> reference,
BundleContext context)
Gets a service object. |
|
URL |
getURL(String protocol,
String host,
int port,
String file,
URLStreamHandler handler)
Gets a URL. |
|
ZipFile |
getZipFile(File file)
Returns a ZipFile. |
|
boolean |
isDirectory(File file)
Returns true if a file is a directory, otherwise false is returned. |
|
long |
lastModified(File file)
Returns a file's last modified stamp. |
|
long |
length(File file)
Returns the length of a file. |
|
String[] |
list(File file)
Returns a file's list. |
|
Class<?> |
loadSystemClass(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 PrivilegedAction<SecureAction> createSecureAction()
SecureAction secureAction = (SecureAction) AccessController.doPrivileged(SecureAction.createSecureAction());
public String getProperty(String property)
property - the property key.
public String getProperty(String property,
String def)
property - the property key.def - the default value if the property key does not exist.
public Properties getProperties()
public FileInputStream getFileInputStream(File file)
throws FileNotFoundException
file - the File to craete a FileInputStream from.
FileNotFoundException - if the File does not exist.
public FileOutputStream getFileOutputStream(File file,
boolean append)
throws FileNotFoundException
file - the File to create a FileOutputStream from.append - indicates if the OutputStream should append content.
FileNotFoundException - if the File does not exist.public long length(File file)
file - a file object
public String getCanonicalPath(File file)
throws IOException
file - a file object
IOException - on errorpublic boolean exists(File file)
file - a file object
public boolean isDirectory(File file)
file - a file object
public long lastModified(File file)
file - a file object
public String[] list(File file)
file - a file object
public ZipFile getZipFile(File file)
throws IOException
file - the file to get a ZipFile for
IOException - if an error occured
public URL getURL(String protocol,
String host,
int port,
String file,
URLStreamHandler handler)
throws 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
MalformedURLException
public Thread createThread(Runnable target,
String name,
ClassLoader contextLoader)
target - the Runnable to create the Thread from.name - The name of the Thread.contextLoader - the context class loader for the thread
public <S> S getService(ServiceReference<S> reference,
BundleContext context)
reference - the ServiceReferencecontext - the BundleContext
public Class<?> forName(String name)
throws ClassNotFoundException
name - the name of the class.
ClassNotFoundException
public Class<?> loadSystemClass(String name)
throws ClassNotFoundException
name - the name of the class.
ClassNotFoundExceptionpublic 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 | |||||||||