Хочу скачать содержимое каталога, но вылезает ошибка - java.io.IOException: Server returned HTTP response code: 403 for URL:
https://minecrafttest.ucoz.net/Download/
public static void loadFile() {
try {
URL url = new URL("https://minecrafttest.ucoz.net/Download/");
URLConnection connection = url.openConnection();
File client = new File("C:/Users/pc/Desktop/load/" + "natives");
BufferedInputStream input = new BufferedInputStream(connection.getInputStream());
FileOutputStream output = new FileOutputStream(client);
byte[] buffer = new byte[4096];
int count = 0;
while ((count = input.read(buffer)) != -1) {
output.write(buffer, 0, count);
}
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}