|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.internal.baseadaptor.AdaptorUtil
public class AdaptorUtil
A utility class with some generally useful static methods for adaptor hook implementations
| Field Summary | |
|---|---|
static byte |
NULL
The NULL tag used in bundle storage |
static byte |
OBJECT
The OBJECT tag used in bundle storage |
| Constructor Summary | |
|---|---|
AdaptorUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
canWrite(File installDir)
|
static void |
copyDir(File inDir,
File outDir)
Does a recursive copy of one directory to another. |
static URL |
encodeFileURL(File file)
|
static byte[] |
getBytes(InputStream in,
int length,
int BUF_SIZE)
|
static Dictionary<String,String> |
loadManifestFrom(BaseData bundledata)
|
static Version |
loadVersion(DataInputStream in)
|
static void |
readFile(InputStream in,
File file)
Read a file from an InputStream and write it to the file system. |
static String |
readString(DataInputStream in,
boolean intern)
|
static ServiceRegistration<?> |
register(String name,
Object service,
BundleContext context)
Register a service object. |
static boolean |
rm(File file)
This function performs the equivalent of "rm -r" on a file or directory. |
static void |
writeStringOrNull(DataOutputStream out,
String string)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte NULL
public static final byte OBJECT
| Constructor Detail |
|---|
public AdaptorUtil()
| Method Detail |
|---|
public static void copyDir(File inDir,
File outDir)
throws IOException
inDir - input directory to copy.outDir - output directory to copy to.
IOException - if any error occurs during the copy.
public static void readFile(InputStream in,
File file)
throws IOException
in - InputStream from which to read. This stream will be closed by this method.file - output file to create.
IOExceptionpublic static boolean rm(File file)
file - file or directory to delete
public static String readString(DataInputStream in,
boolean intern)
throws IOException
IOException
public static void writeStringOrNull(DataOutputStream out,
String string)
throws IOException
IOException
public static Version loadVersion(DataInputStream in)
throws IOException
IOException
public static ServiceRegistration<?> register(String name,
Object service,
BundleContext context)
name - the service class nameservice - the service objectcontext - the registering bundle context
public static Dictionary<String,String> loadManifestFrom(BaseData bundledata)
throws BundleException
BundleExceptionpublic static boolean canWrite(File installDir)
public static URL encodeFileURL(File file)
throws MalformedURLException
MalformedURLException
public static byte[] getBytes(InputStream in,
int length,
int BUF_SIZE)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||