*
* @see jSimMacs.logic.location.DataHandler#createDirectory(java.lang.String, boolean)
*/
public boolean createDirectory(String dir, boolean absolutePath) throws IOException {
boolean success = true;
SFTPv3Client sftpConn = null;
String directory = dir;
if(!absolutePath)
directory = rProject.getPath() + dir;
try {
sftpConn = new SFTPv3Client(conn);
boolean createDir = true;
try {
sftpConn.lstat(directory);
createDir = false;
} catch (IOException e) {
createDir = true;
}
if (createDir)
sftpConn.mkdir(directory, standardPermission);
} catch (IOException e) {
success = false;
throw e;
} finally {
if (sftpConn != null)
sftpConn.close();
}
return success;
}