org.biojava.bio.structure.io.util
Class FileDownloadUtils

java.lang.Object
  extended by org.biojava.bio.structure.io.util.FileDownloadUtils

public class FileDownloadUtils
extends Object


Constructor Summary
FileDownloadUtils()
           
 
Method Summary
static void copy(File src, File dst)
          Copy the content of file A to B
static File downloadFileIfAvailable(URL url, File destination)
           
static void downloadGzipCompressedFile(URL url, File destination)
          Download the content provided at URL url and stores the result to a local file
static String getFileExtension(File f)
           
static String getFilePrefix(File f)
           
static String toUnixPath(String path)
          Converts path to Unix convention and adds a terminating slash if it was omitted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDownloadUtils

public FileDownloadUtils()
Method Detail

copy

public static void copy(File src,
                        File dst)
                 throws IOException
Copy the content of file A to B

Parameters:
src -
dst -
Throws:
IOException

getFileExtension

public static String getFileExtension(File f)

getFilePrefix

public static String getFilePrefix(File f)

downloadGzipCompressedFile

public static void downloadGzipCompressedFile(URL url,
                                              File destination)
                                       throws IOException
Download the content provided at URL url and stores the result to a local file

Parameters:
url -
destination -
Throws:
IOException

downloadFileIfAvailable

public static File downloadFileIfAvailable(URL url,
                                           File destination)
                                    throws IOException
Throws:
IOException

toUnixPath

public static String toUnixPath(String path)
Converts path to Unix convention and adds a terminating slash if it was omitted

Parameters:
path - original platform dependent path
Returns:
path in Unix convention
Since:
3.2