URL url = new URL("https://docs.google.com/document/d/1y-5CywpDncyeVSZIyEKLwU3KcI3gRvAeu73Ty-yIZQY");
InputStream input = url.openStream();
int i = 0;
while (i!=-1) {
i = input.read();
System.out.print((char)i);
}
В данном случае читается HTML код, хотя из него можно выдернуть текст
2)
URL url = new URL("https://drive.google.com/file/d/1FEP6weZQRhCj3-jdsXNb4-KclT-lhuB8/view?usp=drivesdk");
URLConnection connection = url.openConnection();
try (OutputStream output = connection.getOutputStream();
PrintStream sender = new PrintStream(output)) {
sender.println("Привет");
}
try(InputStream input = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(input))) {
while (reader.ready()) System.out.println(reader.readLine());
}
Данный вариант вообще не работает, с записью и чтением
Возможно, что-то с ссылкой из облака, я пробовал гугл диск и mail диск. Как тогда по-другому сохранять текстовый файл в облако.