public class Utilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TEMPDIRECTORYPATH
Deprecated.
use TemporaryFolderManager
|
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanComponent(Component baseComponent)
Method which frees the memory from JInternalFrames
|
protected static void |
cleanComponent(Component baseComponent,
int depth) |
static void |
cleanUpTempFiles()
Deprecated.
use TemporaryFolderManager.cleanAll()
|
static ImageIcon |
createImageIcon(String path)
Creates an icon from an image path.
|
static File |
createTemp(String fileName,
String data)
Deprecated.
use TemporaryFolderManager.createTemporaryFile()
|
static String |
createTempDirectory()
Deprecated.
use TemporaryFolderManager.createTemporaryFolder()
|
static File |
downloadFile(URL url,
String name)
Downloads an URL into a temporary file that is removed the next time the
tempFileManager class is called, which means the next time gvSIG is
launched.
|
static void |
extractTo(File file,
File dir,
MultiSplashWindow splash)
Extracts a ZIP file in the provided directory
|
static String |
getTempDirectory()
Deprecated.
use TemporaryFolderManager.getTemporaryFolder()
|
static void |
removeURL(URL url)
Remove an URL from the system cache.
|
public static final String TEMPDIRECTORYPATH
public static String getTempDirectory()
public static void cleanUpTempFiles()
public static File createTemp(String fileName, String data) throws IOException
fileName
- Name of the temporary file to createdata
- The data to store in the fileIOException
public static String createTempDirectory()
public static ImageIcon createImageIcon(String path)
path
- Path to the image to be loadedpublic static void cleanComponent(Component baseComponent)
baseComponent
- JInternalFrame whose memory is to be freedprotected static void cleanComponent(Component baseComponent, int depth)
public static void extractTo(File file, File dir, MultiSplashWindow splash) throws ZipException, IOException
file
- Compressed filedir
- Directory to extract the filessplash
- The splash window to show the extraction progressZipException
- If there is some problem in the file formatIOException
- If there is a problem reading the filepublic static File downloadFile(URL url, String name) throws IOException, ConnectException, UnknownHostException
url
- name
- IOException
ServerErrorResponseException
ConnectException
UnknownHostException
public static void removeURL(URL url)
request
-