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 path, HashCode hash) private static booleancheckExistingFile(Path path, HashFunction hashFunction, HashCode expectedHash) private static HashCodedownloadAndHash(HashFunction hashFuntion, int maxSize, HttpUtil.DownloadProgressListener progressListener, InputStream stream, Path outputPath) static PathdownloadFile(Path saveFile, URL url, Map<String, String> requestProperties, HashFunction hashFunction, HashCode hash, int maxSize, Proxy proxy, HttpUtil.DownloadProgressListener progressListener) static intprivate static HashCodehashFile(Path path, HashFunction hashFunction) static booleanisPortAvailable(int port) private static voidupdateModificationTime(Path path)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
HttpUtil
private HttpUtil()
-
-
Method Details
-
downloadFile
public static Path downloadFile(Path saveFile, URL url, Map<String, String> requestProperties, HashFunction hashFunction, @Nullable HashCode hash, int maxSize, Proxy proxy, HttpUtil.DownloadProgressListener progressListener) -
updateModificationTime
-
hashFile
- Throws:
IOException
-
checkExistingFile
private static boolean checkExistingFile(Path path, HashFunction hashFunction, HashCode expectedHash) throws IOException - Throws:
IOException
-
cachedFilePath
-
downloadAndHash
private static HashCode downloadAndHash(HashFunction hashFuntion, int maxSize, HttpUtil.DownloadProgressListener progressListener, InputStream stream, Path outputPath) throws IOException - Throws:
IOException
-
getAvailablePort
public static int getAvailablePort() -
isPortAvailable
public static boolean isPortAvailable(int port)
-