Package org.nd4j.common.io
Class ResourceUtils
- java.lang.Object
-
- org.nd4j.common.io.ResourceUtils
-
public abstract class ResourceUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASSPATH_URL_PREFIXstatic StringFILE_URL_PREFIXstatic StringJAR_URL_SEPARATORstatic StringURL_PROTOCOL_CODE_SOURCEstatic StringURL_PROTOCOL_FILEstatic StringURL_PROTOCOL_JARstatic StringURL_PROTOCOL_VFSstatic StringURL_PROTOCOL_VFSZIPstatic StringURL_PROTOCOL_WSJARstatic StringURL_PROTOCOL_ZIP
-
Constructor Summary
Constructors Constructor Description ResourceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringclassPackageAsResourcePath(Class<?> clazz)static URLextractJarFileURL(URL jarUrl)static FilegetFile(String resourceLocation)static FilegetFile(URI resourceUri)static FilegetFile(URI resourceUri, String description)static FilegetFile(URL resourceUrl)static FilegetFile(URL resourceUrl, String description)static URLgetURL(String resourceLocation)static booleanisFileURL(URL url)static booleanisJarURL(URL url)static booleanisUrl(String resourceLocation)static URItoURI(String location)static URItoURI(URL url)static voiduseCachesIfNecessary(URLConnection con)
-
-
-
Field Detail
-
CLASSPATH_URL_PREFIX
public static final String CLASSPATH_URL_PREFIX
- See Also:
- Constant Field Values
-
FILE_URL_PREFIX
public static final String FILE_URL_PREFIX
- See Also:
- Constant Field Values
-
URL_PROTOCOL_FILE
public static final String URL_PROTOCOL_FILE
- See Also:
- Constant Field Values
-
URL_PROTOCOL_JAR
public static final String URL_PROTOCOL_JAR
- See Also:
- Constant Field Values
-
URL_PROTOCOL_ZIP
public static final String URL_PROTOCOL_ZIP
- See Also:
- Constant Field Values
-
URL_PROTOCOL_VFSZIP
public static final String URL_PROTOCOL_VFSZIP
- See Also:
- Constant Field Values
-
URL_PROTOCOL_VFS
public static final String URL_PROTOCOL_VFS
- See Also:
- Constant Field Values
-
URL_PROTOCOL_WSJAR
public static final String URL_PROTOCOL_WSJAR
- See Also:
- Constant Field Values
-
URL_PROTOCOL_CODE_SOURCE
public static final String URL_PROTOCOL_CODE_SOURCE
- See Also:
- Constant Field Values
-
JAR_URL_SEPARATOR
public static final String JAR_URL_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isUrl
public static boolean isUrl(String resourceLocation)
-
getURL
public static URL getURL(String resourceLocation) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFile
public static File getFile(String resourceLocation) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFile
public static File getFile(URL resourceUrl) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFile
public static File getFile(URL resourceUrl, String description) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFile
public static File getFile(URI resourceUri) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFile
public static File getFile(URI resourceUri, String description) throws FileNotFoundException
- Throws:
FileNotFoundException
-
isFileURL
public static boolean isFileURL(URL url)
-
isJarURL
public static boolean isJarURL(URL url)
-
extractJarFileURL
public static URL extractJarFileURL(URL jarUrl) throws MalformedURLException
- Throws:
MalformedURLException
-
toURI
public static URI toURI(URL url) throws URISyntaxException
- Throws:
URISyntaxException
-
toURI
public static URI toURI(String location) throws URISyntaxException
- Throws:
URISyntaxException
-
useCachesIfNecessary
public static void useCachesIfNecessary(URLConnection con)
-
-