JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 27.08.2016, 13:17
ds1508's Avatar
ds1508 ds1508 is offline
DSL User
 
Join Date: Jul 2016
Location: Germany, NRW
Posts: 38
Question myFilePath Security Error

Hallö,
bisher habe ich immer per Knopfdruck aus der Downloadliste die fehlenden Ordner erstellen lassen. Leider funktioniert das seit dem letzten Update nicht mehr:
Code:
                    var packageDownloadFolder = myFilePackage.getDownloadFolder();
                    var myFilePath = getPath(packageDownloadFolder);
                    if (!myFilePath.exists()) {
                        if (myFilePath.mkdirs()) {
                            t += " (Folder created)\r\n";
                        } else {
                            t += " (create folder Error)\r\n";
                        }
                    } else {
                        t += " (Folder exists)\r\n";
                    }
Bekomme immer einen Java-Fehler. Siehe Bild im Anhang.
Attached Thumbnails
Aufnahme1.jpg  
__________________
--
In special cases you may contact me on Discord: http://bit.ly/dsDisco
Reply With Quote
  #2  
Old 28.08.2016, 18:27
ZereoX ZereoX is offline
Modem User
 
Join Date: Aug 2016
Posts: 2
Default [Event Scripter] - getPath() Security Violation

I created a small 2 line script to move finished packages from my Downloads folder to my Completed folder, but in the past 2 days I've been getting an error message every time the script is ran (Script was running without issues for over a year).

Script:
Code:
if (package.isFinished() == true) {
    getPath(package.getDownloadFolder()).moveTo("/home/zereox/Downloads/Completed");
}
Error:
Code:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: Security Violation: Security Violation org.jdownloader.extensions.eventscripter.sandboxobjects.FilePathSandbox17 (#1)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3613)
	at org.jdownloader.extensions.eventscripter.ScriptThread.isClassVisibleToScript(ScriptThread.java:359)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory$2.visibleToScripts(JSHtmlUnitPermissionRestricter.java:163)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.<init>(JavaMembers.java:31)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.lookupClass(JavaMembers.java:785)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.initMembers(NativeJavaObject.java:53)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.<init>(NativeJavaObject.java:43)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.<init>(NativeJavaObject.java:34)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxNativeJavaObject.<init>(JSHtmlUnitPermissionRestricter.java:284)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory.wrapAsJavaObject(JSHtmlUnitPermissionRestricter.java:273)
	at net.sourceforge.htmlunit.corejs.javascript.WrapFactory.wrap(WrapFactory.java:72)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory.wrap(JSHtmlUnitPermissionRestricter.java:251)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:222)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	at script(:1)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:212)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:110)
Reply With Quote
  #3  
Old 29.08.2016, 09:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 67,320
Default

will be fixed with next update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 30.08.2016, 07:14
ZereoX ZereoX is offline
Modem User
 
Join Date: Aug 2016
Posts: 2
Default

I can confirm that I am no longer receiving the error message and script is functioning as before.

Build Date: Tue 30 03:05:07 CEST 2016
Core: #34784

Thank you very much.
Reply With Quote
  #5  
Old 30.08.2016, 09:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 67,320
Default

Thanks for the feedback!
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 07:02.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.