I am using following code to create a text file on remote window server:
String archiveFolder=\\etld90\\DM;
new File(archiveFolder + File.separator + "done" + ".txt");
Its not giving any error but also not creating a file.
This only creates the File object in memory
createNewFile() - "Atomically creates a new, empty file named by this abstract path name if and only if a file with this name does not yet exist"
Here's some code demonstrating it
File myObj = new File("filename.txt");
if (myObj.createNewFile()) {
System.out.println("File created: " + myObj.getName());
}
else {
System.out.println("File already exists.");
}
Fileobject in memory that is immediately discarded.