|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.update.core.Utilities
This class is a collection of utility functions that can be used for install processing
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Constructor Summary | |
Utilities()
|
Method Summary | |
static void |
copy(InputStream is,
OutputStream os,
InstallMonitor monitor)
Copies specified input stream to the output stream. |
static File |
createLocalFile(File tmpDir,
String name)
Create a new working file. |
static File |
createWorkingDirectory()
Returns a new working directory (in temporary space). |
static void |
flushLocalFile()
Flushes all the keys from the local file map. |
static String |
format(Date date)
Formats a Date based on the default Locale If teh Date is null returns an empty String |
static File |
lookupLocalFile(String key)
Returns a previously cached local file (in temporary area) matching the specified key. |
static void |
mapLocalFile(String key,
File temp)
The file is associated with a lookup key. |
static CoreException |
newCoreException(String s,
int code,
Throwable e)
Creates a CoreException from some other exception. |
static CoreException |
newCoreException(String s,
String s1,
String s2,
CoreException e1,
CoreException e2)
Creates a CoreException from two other CoreException |
static CoreException |
newCoreException(String s,
Throwable e)
Creates a CoreException from some other exception. |
static void |
removeLocalFile(String key)
Removes the specified key from the local file map. |
static void |
shutdown()
Perform shutdown processing for temporary file handling. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Utilities()
Method Detail |
public static File createWorkingDirectory() throws IOException
IOException
public static File createLocalFile(File tmpDir, String name) throws IOException
tmpDir
- directory location for new file. Any missing directory
levels are created (and marked for deletion on exit)name
- optional file name, or null
. If name is not
specified, a temporary name is generated.
IOException
lookupLocalFile(String)
public static void mapLocalFile(String key, File temp)
key
- optional lookup key, or null
.temp
- the local working filepublic static File lookupLocalFile(String key)
key
- lookup key
null
.public static void flushLocalFile()
public static void removeLocalFile(String key)
key
- lookup keypublic static void copy(InputStream is, OutputStream os, InstallMonitor monitor) throws IOException, InstallAbortedException
is
- input streamos
- output streammonitor
- progress monitor
IOException
InstallAbortedException
public static CoreException newCoreException(String s, int code, Throwable e)
IStatus.ERROR
If the exception passed as a parameter is also a CoreException,
the new CoreException will contain all the status of the passed
CoreException.
s
- exception stringcode
- the code reportede
- actual exception being reported
IStatus.ERROR
public static CoreException newCoreException(String s, Throwable e)
IStatus.ERROR
If the exceptionpassed as a parameter is also a CoreException,
the new CoreException will contain all the status of the passed
CoreException.
s
- exception stringe
- actual exception being reported
IStatus.ERROR
public static CoreException newCoreException(String s, String s1, String s2, CoreException e1, CoreException e2)
s
- overall exception strings1
- string for first detailed exceptions2
- string for second detailed exceptione1
- first detailed exceptione2
- second detailed exception
public static String format(Date date)
null
returns an empty String
date
- the Date to format
public static void shutdown()
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.