cannot create directory

69 views
Skip to first unread message

Orhun D.

unread,
Aug 19, 2016, 2:46:47 PM8/19/16
to sardine
Hi,

I am able to add new rules into existing directory but I cannot create a new directory.
What am I doing wrong ?


private final String url = "http://localhost:7099/guvnor/org.drools.guvnor.Guvnor/webdav/packages/";
private final String username = "";
private final String password = "";

// WORKS
private void addARule() throws IOException {
Sardine sardine = SardineFactory.begin(username, password);
String ruleDescription = "when Entity(entityName==\"Car1s\") then System.out.println(\"*************rule executed\")";
byte[] data = ruleDescription.getBytes();
sardine.put(url + "Sardine/SimpleDRLRule.drl", data);
System.out.println("Rule added ...");
}

// NOT WORKING
private void createPackage() throws IOException {
Sardine sardine = SardineFactory.begin(username, password);
sardine.createDirectory(url + "SardineTestPack");
System.out.println("new package created.");
}

Orhun D.

unread,
Aug 19, 2016, 3:36:14 PM8/19/16
to sardine
Additionally, MKCOL method returns HTTP 200 OK but on server logs of guvnor it raises an error as 

Aug 19, 2016 10:35:01 PM org.drools.repository.RulesRepository loadPackage
SEVERE: Unable to load a rule package. 
javax.jcr.PathNotFoundException: SardineTestPack

Orhun D.

unread,
Aug 22, 2016, 7:51:27 AM8/22/16
to sardine
Server access logs seems ok by the way;
"MKCOL /guvnor/org.drools.guvnor.Guvnor/webdav/packages/SardineTestPack/ HTTP/1.1" 200 0
Reply all
Reply to author
Forward
0 new messages