Added command 'createFolder(string)'
This commit is contained in:
parent
5a0566ae01
commit
371288ac20
|
@ -128,6 +128,39 @@ public final class ButterflyClient
|
|||
}
|
||||
}
|
||||
|
||||
public void createFolder(string folderPath)
|
||||
{
|
||||
/**
|
||||
* Construct the command.
|
||||
*/
|
||||
JSONValue commandBlock;
|
||||
commandBlock["command"] = "createFolder";
|
||||
|
||||
JSONValue requestBlock;
|
||||
requestBlock["folderName"] = folderPath;
|
||||
|
||||
commandBlock["request"] = requestBlock;
|
||||
|
||||
/* Send the command */
|
||||
sendMessage(connection, cast(byte[])toJSON(commandBlock));
|
||||
|
||||
/* Get the status */
|
||||
JSONValue response;
|
||||
|
||||
byte[] receivedBytes;
|
||||
receiveMessage(connection, receivedBytes);
|
||||
response = parseJSON(cast(string)receivedBytes);
|
||||
|
||||
if(response["status"].integer() == 0)
|
||||
{
|
||||
/* TODO: Good */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: Throw an exception here */
|
||||
}
|
||||
}
|
||||
|
||||
public string[] listMail(string folderPath)
|
||||
{
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue