public class MainApp {
public static void main(String[] args) throws IOException {
File parent = new File("config");
File file = new File(parent,"aa.txt");
File file1 = new File("idea\\java\\datasource","aa.txt");
file.exists();
System.out.println(new MainApp().getClass().getResource(""));
System.out.println(new MainApp().getClass().getResource("/"));
try {
file = new File(new MainApp().getClass().getResource("MainApp.class").toURI());
file = new File(new MainApp().getClass().getResource("../aruiea/MainApp.class").toURI());
} catch (URISyntaxException e) {
e.printStackTrace();
}
System.out.println(file.exists());
String str = "/com" + File.separator+"aruiea";
file.canRead();
file.canWrite();
boolean newFile = file.createNewFile();
file.delete();
file.deleteOnExit();
file.getAbsolutePath();
file.getPath();
file.getName();
file.isDirectory();
file.isFile();
file.mkdir();
file.mkdirs();
file.renameTo(new File("new dest"));
file.listFiles();
file.getParentFile();
File file2 = new File("file/upload/text/aaa.txt");
if (!file2.exists()) {
file2.mkdirs();
}
File[] files = new File("new dest").listFiles();
for (File file3 : files) {
String name = file3.getName();
System.out.println(name);
}
file.deleteOnExit();
file1.deleteOnExit();
file2.deleteOnExit();
}
}