Class HttpUtil
java.lang.Object
net.minecraft.util.HttpUtil
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static PathcachedFilePath(Path targetDir, HashCode requestedHash) private static booleancheckExistingFile(Path file, HashFunction hashFunction, HashCode expectedHash) private static HashCodedownloadAndHash(HashFunction hashFunction, int maxSize, HttpUtil.DownloadProgressListener listener, InputStream input, Path downloadFile) static PathdownloadFile(Path targetDir, URL url, Map<String, String> headers, HashFunction hashFunction, @Nullable HashCode requestedHash, int maxSize, Proxy proxy, HttpUtil.DownloadProgressListener listener) static intprivate static HashCodehashFile(Path file, HashFunction hashFunction) static booleanisPortAvailable(int port) private static voidupdateModificationTime(Path targetFile)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
HttpUtil
private HttpUtil()
-
-
Method Details
-
downloadFile
public static Path downloadFile(Path targetDir, URL url, Map<String, String> headers, HashFunction hashFunction, @Nullable HashCode requestedHash, int maxSize, Proxy proxy, HttpUtil.DownloadProgressListener listener) -
updateModificationTime
-
hashFile
- Throws:
IOException
-
checkExistingFile
private static boolean checkExistingFile(Path file, HashFunction hashFunction, HashCode expectedHash) throws IOException - Throws:
IOException
-
cachedFilePath
-
downloadAndHash
private static HashCode downloadAndHash(HashFunction hashFunction, int maxSize, HttpUtil.DownloadProgressListener listener, InputStream input, Path downloadFile) throws IOException - Throws:
IOException
-
getAvailablePort
public static int getAvailablePort() -
isPortAvailable
public static boolean isPortAvailable(int port)
-