Good afternoon, when you try to unload resources from the system disk C: \
InputStream in = Main.class.getResourceAsStream("scr/resources/sp/Sp.exe"); DataInputStream din = new DataInputStream(in); FileOutputStream outF = new FileOutputStream("C:/SP"); byte[] buffer = new byte[1024]; int count = 0; while ((count=din.read(buffer)) != -1){ outF.write(buffer,0,count); } outF.flush(); outF.close(); in the created folder produces the following error:
Exception in thread "main" java.io.FileNotFoundException: C:\SP (Отказано в доступе) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at java.io.FileOutputStream.<init>(FileOutputStream.java:101) at com4j_example.Main.main(Main.java:89) and so with any place of discharge.