Class ResourceFile
- java.lang.Object
-
- org.nd4j.common.resources.strumpf.ResourceFile
-
public class ResourceFile extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCOMPRESSED_HASHprotected intcurrent_versionstatic intDEFAULT_CONNECTION_TIMEOUTDefault value for resource downloading connection timeout - seeND4JSystemProperties.RESOURCES_CONNECTION_TIMEOUTstatic intDEFAULT_READ_TIMEOUTDefault value for resource downloading read timeout - seeND4JSystemProperties.RESOURCES_READ_TIMEOUTprotected StringfilePathprotected static StringHASHstatic org.nd4j.shade.jackson.databind.ObjectMapperMAPPERprotected static intMAX_DOWNLOAD_ATTEMPTSprotected static StringPATH_KEYprotected Map<String,String>v1
-
Constructor Summary
Constructors Constructor Description ResourceFile()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourceFilefromFile(File file)static ResourceFilefromFile(String path)protected FilegetLocalFile(File cacheRootDir)Get the local file - or where it *would* be if it has been downloaded.FilelocalFile(File cacheRootDir)Get the local file - downloading and caching if requiredbooleanlocalFileExistsAndValid(File cacheRootDir)static org.nd4j.shade.jackson.databind.ObjectMappernewMapper()StringrelativePath()static Stringsha256(File f)
-
-
-
Field Detail
-
DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_CONNECTION_TIMEOUT
Default value for resource downloading connection timeout - seeND4JSystemProperties.RESOURCES_CONNECTION_TIMEOUT- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
Default value for resource downloading read timeout - seeND4JSystemProperties.RESOURCES_READ_TIMEOUT- See Also:
- Constant Field Values
-
PATH_KEY
protected static final String PATH_KEY
- See Also:
- Constant Field Values
-
HASH
protected static final String HASH
- See Also:
- Constant Field Values
-
COMPRESSED_HASH
protected static final String COMPRESSED_HASH
- See Also:
- Constant Field Values
-
MAX_DOWNLOAD_ATTEMPTS
protected static final int MAX_DOWNLOAD_ATTEMPTS
- See Also:
- Constant Field Values
-
MAPPER
public static final org.nd4j.shade.jackson.databind.ObjectMapper MAPPER
-
current_version
protected int current_version
-
filePath
protected String filePath
-
-
Method Detail
-
fromFile
public static ResourceFile fromFile(String path)
-
fromFile
public static ResourceFile fromFile(File file)
-
relativePath
public String relativePath()
-
localFileExistsAndValid
public boolean localFileExistsAndValid(File cacheRootDir)
-
getLocalFile
protected File getLocalFile(File cacheRootDir)
Get the local file - or where it *would* be if it has been downloaded. If it does not exist, it will not be downloaded here- Returns:
-
localFile
public File localFile(File cacheRootDir)
Get the local file - downloading and caching if required- Returns:
-
newMapper
public static final org.nd4j.shade.jackson.databind.ObjectMapper newMapper()
-
-