Import Java.io.BufferedReader;
Import Java.io.BufferedWriter;
Import Java.io.File;
Import java.io.FileNotFoundException;
Import Java.io.FileReader;
Import Java.io.FileWriter;
Import java.io.IOException;
public class Tttt {
public static void Main (string[] args) {
String lujing = "//2560p-pc/servermsglist/111.sisenmsg";//remote address and file can be changed as needed
File File = new file (lujing);
if (!file.getparentfile (). exists ()) {
File.getparentfile (). Mkdirs ();
}
try {
File.createnewfile ();
} catch (IOException e) {
E.printstacktrace ();
}
try {
FileWriter FW = new FileWriter (file, false);
BufferedWriter bw = new BufferedWriter (FW);
Bw.write ("False\r\n\r\n\r\ntrue\r\nhello Worodddada");
Bw.flush ();
Bw.close ();
Fw.close ();
} catch (IOException e) {
E.printstacktrace ();
}
try {
FileReader FR = new FileReader (file);
BufferedReader breader = new BufferedReader (FR);
String string = Breader.readline ();
System.out.println (string);
Fr.close ();
Breader.close ();
} catch (FileNotFoundException e) {
E.printstacktrace ();
} catch (IOException e) {
E.printstacktrace ();
}
}
}
Java implementation Remote Storage read file