Interface DownloadableResource
-
- All Known Implementing Classes:
BaseResource,CustomResource,DataSetResource,Dl4jZooResource,OmniHubResource,StrumpfResource
public interface DownloadableResourceA downloadable resource represents a resource that is downloadable and cached in a specified directory. This will usually be in the user's home directory under a hidden dot directory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringarchiveFileName()The name of the archive file to be downloadeddefault voiddelete()default voiddownload(boolean archive, int retries, int connectionTimeout, int readTimeout)default booleanexistsLocally()StringfileName()The name of the file to be downloaded or if an archive, the naem of the extracted fileFilelocalCacheDirectory()The storage location representing the directory cachedefault FilelocalPath()The local path to the file.default Stringmd5Sum()Md5sum of the file.ResourceTyperesourceType()Returns the resource type for this resourceStringrootUrl()The root url to the resource.
-
-
-
Method Detail
-
fileName
String fileName()
The name of the file to be downloaded or if an archive, the naem of the extracted file- Returns:
-
archiveFileName
String archiveFileName()
The name of the archive file to be downloaded- Returns:
-
rootUrl
String rootUrl()
The root url to the resource. This is going to be the directory name of where the file lives.- Returns:
-
localCacheDirectory
File localCacheDirectory()
The storage location representing the directory cache- Returns:
-
localPath
default File localPath()
The local path to the file. This will usually belocalCacheDirectory()+fileName()- Returns:
-
md5Sum
default String md5Sum()
Md5sum of the file. Used for verification maybe empty to avoid running verification.- Returns:
-
download
default void download(boolean archive, int retries, int connectionTimeout, int readTimeout)
-
resourceType
ResourceType resourceType()
Returns the resource type for this resource- Returns:
-
existsLocally
default boolean existsLocally()
- Returns:
-
delete
default void delete() throws IOException- Throws:
IOException
-
-