Package net.minecraft.util
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 pPath, HashCode pHash) private static booleancheckExistingFile(Path pPath, HashFunction pHashFunction, HashCode pExpectedHash) private static HashCodedownloadAndHash(HashFunction pHashFunction, int pMaxSize, HttpUtil.DownloadProgressListener pProgressListener, InputStream pStream, Path pOutputPath) static PathdownloadFile(Path pSaveFile, URL pUrl, Map<String, String> pRequestProperties, HashFunction pHashFunction, HashCode pHash, int pMaxSize, Proxy pProxy, HttpUtil.DownloadProgressListener pProgressListener) static intprivate static HashCodehashFile(Path pPath, HashFunction pHashFunction) static booleanisPortAvailable(int pPort) private static voidupdateModificationTime(Path pPath)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
HttpUtil
private HttpUtil()
-
-
Method Details
-
downloadFile
public static Path downloadFile(Path pSaveFile, URL pUrl, Map<String, String> pRequestProperties, HashFunction pHashFunction, @Nullable HashCode pHash, int pMaxSize, Proxy pProxy, HttpUtil.DownloadProgressListener pProgressListener) -
updateModificationTime
-
hashFile
- Throws:
IOException
-
checkExistingFile
private static boolean checkExistingFile(Path pPath, HashFunction pHashFunction, HashCode pExpectedHash) throws IOException - Throws:
IOException
-
cachedFilePath
-
downloadAndHash
private static HashCode downloadAndHash(HashFunction pHashFunction, int pMaxSize, HttpUtil.DownloadProgressListener pProgressListener, InputStream pStream, Path pOutputPath) throws IOException - Throws:
IOException
-
getAvailablePort
public static int getAvailablePort() -
isPortAvailable
public static boolean isPortAvailable(int pPort)
-