public class NetTools
extends java.lang.Object
Constructor and Description |
---|
NetTools() |
Modifier and Type | Method and Description |
---|---|
static java.net.URI |
build(java.lang.String... parts)
Builds a URI from the given parts.
|
static java.nio.file.Path |
downloadToPath(java.net.URI uri,
java.lang.String username,
java.lang.String password,
MD5 md5)
Downloads the resource given.
|
public static java.net.URI build(java.lang.String... parts) throws java.net.URISyntaxException
parts
- The partsjava.net.URISyntaxException
- If the parts passed in are not valid URI components.public static java.nio.file.Path downloadToPath(java.net.URI uri, java.lang.String username, java.lang.String password, MD5 md5) throws java.io.IOException, MD5Exception
uri
- The resource.username
- (Optional) The username that might be used to connect to the resource.password
- (Optional) The password that might be used to connect to the resource.md5
- (Optional) The MD5 of the resource (to verify).java.io.IOException
- If the resource could not be downloaded.MD5Exception
- If the file was downloaded but doesn't match the MD5 sum.