Douglas Farias Expert Licensed User Longtime User Dec 16, 2014 #1 Code: Copy target = File.DirApp File.MakeDir(target, "Arquivos_Recebidos") fp = File.Combine(target,"Arquivos_Recebidos" ) i made this code to make a folder of my .jar my .jar receiv files from the android and store this file on this folder. but i dont understand why i have permission error when i try save itens on this folder if i dont use fp this works only file.dirapp but if i use file.dirapp & "Arquivos_Recebidos" = fp i have this error log Program started. asyncstreamsobject._astream_newstream (java line: 138) java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:455) at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:424) at b4j.example.asyncstreamsobject._astream_newstream(asyncstreamsobject.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) at anywheresoftware.b4a.BA$3.run(BA.java:178) at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292) at com.sun.javafx.application.PlatformImpl$$Lambda$47/7929364.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl$$Lambda$46/7135120.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102) at com.sun.glass.ui.win.WinApplication$$Lambda$37/24247422.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:446) ... 18 more Caused by: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:345) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:318) at b4j.example.main._astreamo_newobject(main.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) ... 19 more Click to expand... why this? how can i make a fixed folder to save my files under the pc? i want to save this in a folder. thx
Code: Copy target = File.DirApp File.MakeDir(target, "Arquivos_Recebidos") fp = File.Combine(target,"Arquivos_Recebidos" ) i made this code to make a folder of my .jar my .jar receiv files from the android and store this file on this folder. but i dont understand why i have permission error when i try save itens on this folder if i dont use fp this works only file.dirapp but if i use file.dirapp & "Arquivos_Recebidos" = fp i have this error log Program started. asyncstreamsobject._astream_newstream (java line: 138) java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:455) at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:424) at b4j.example.asyncstreamsobject._astream_newstream(asyncstreamsobject.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) at anywheresoftware.b4a.BA$3.run(BA.java:178) at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292) at com.sun.javafx.application.PlatformImpl$$Lambda$47/7929364.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl$$Lambda$46/7135120.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102) at com.sun.glass.ui.win.WinApplication$$Lambda$37/24247422.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:446) ... 18 more Caused by: java.io.FileNotFoundException: C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos (Acesso negado) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:345) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:318) at b4j.example.main._astreamo_newobject(main.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) ... 19 more Click to expand... why this? how can i make a fixed folder to save my files under the pc? i want to save this in a folder. thx
Erel B4X founder Staff member Licensed User Longtime User Dec 16, 2014 #2 Do you see this folder in Windows Explorer? Upvote 0
Douglas Farias Expert Licensed User Longtime User Dec 16, 2014 #3 yes i can open C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos Click to expand... is the file.dirapp with only a folder, its possible store files in a folder on file.dirapp? the error is permission, but where i add permission at b4j? Upvote 0
yes i can open C:\Users\Douglas\Desktop\MEUSAP~1\EMDESE~1\ABOOPC~1\pc\Objects\Arquivos_Recebidos Click to expand... is the file.dirapp with only a folder, its possible store files in a folder on file.dirapp? the error is permission, but where i add permission at b4j?
Erel B4X founder Staff member Licensed User Longtime User Dec 16, 2014 #4 You cannot add permissions in Windows. My guess is that this error is related to a non-ascii character in the path which breaks something in the Java file handling. Try to save your file in c:\test. Upvote 0
You cannot add permissions in Windows. My guess is that this error is related to a non-ascii character in the path which breaks something in the Java file handling. Try to save your file in c:\test.
Douglas Farias Expert Licensed User Longtime User Dec 16, 2014 #5 @Erel have this error log File.Copy(astreamO.TempFolder, fileName, "c:\test", Key.SubString(8)) Code: Copy Program started. EXISTE asyncstreamsobject._astream_newstream (java line: 136) java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: c:\test (Acesso negado) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:455) at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:424) at b4j.example.asyncstreamsobject._astream_newstream(asyncstreamsobject.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) at anywheresoftware.b4a.BA$3.run(BA.java:178) at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292) at com.sun.javafx.application.PlatformImpl$$Lambda$47/17912246.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl$$Lambda$46/7135120.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102) at com.sun.glass.ui.win.WinApplication$$Lambda$37/24247422.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: c:\test (Acesso negado) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:446) ... 18 more Caused by: java.io.FileNotFoundException: c:\test (Acesso negado) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:345) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:318) at b4j.example.main._astreamo_newobject(main.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) ... 19 more Last edited: Dec 16, 2014 Upvote 0
@Erel have this error log File.Copy(astreamO.TempFolder, fileName, "c:\test", Key.SubString(8)) Code: Copy Program started. EXISTE asyncstreamsobject._astream_newstream (java line: 136) java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: c:\test (Acesso negado) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:455) at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:424) at b4j.example.asyncstreamsobject._astream_newstream(asyncstreamsobject.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) at anywheresoftware.b4a.BA$3.run(BA.java:178) at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292) at com.sun.javafx.application.PlatformImpl$$Lambda$47/17912246.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl$$Lambda$46/7135120.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102) at com.sun.glass.ui.win.WinApplication$$Lambda$37/24247422.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: c:\test (Acesso negado) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:446) ... 18 more Caused by: java.io.FileNotFoundException: c:\test (Acesso negado) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:345) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:318) at b4j.example.main._astreamo_newobject(main.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93) ... 19 more
Erel B4X founder Staff member Licensed User Longtime User Dec 17, 2014 #6 Now I understand. You are trying to open a folder instead of a file. Key.SubString(8) returns an empty string. Upvote 0
Now I understand. You are trying to open a folder instead of a file. Key.SubString(8) returns an empty string.
Douglas Farias Expert Licensed User Longtime User Dec 17, 2014 #7 really, i m noob i forgot to send a arquivo:filenamehere, i have fixed thx erel Upvote 0