/**
* Remove file or folder (recursively)
**/
protected void _remove(File path, boolean fromRecursive) throws ConnectorException {
if (path == null || !path.exists()) {
throw new ConnectorException("Invalid parameters");
}
if (!path.isDirectory()) {
if (!getConfig()._isAllowedExistingDir(path, FileActionEnum.DELETE)) {
throw new ConnectorException("Access denied");
}
try {
getFs().removeFile(path);
} catch (FsException e) {
throw new ConnectorException("Unable to remove file", e);
}
} else {
if (!getConfig()._isAllowedExistingFile(path, FileActionEnum.DELETE)) {
throw new ConnectorException("Access denied");
}
removeDirectory(path, fromRecursive);
}
}