*/
public static boolean generateRequest(ClientPrimitives primitive, OverEncryptRequestType opType, String userId, String path, String... values) {
boolean allOk = false;
OutputStream fileWriter = null;
FileSystemManager vfsManager = null;
//Get a Virtual File System Manager
vfsManager = WebDAVClientManager.getVFSManager();
if(vfsManager == null)LOGGER.debug("vfsManager is null");
switch (opType) {
case LOCK:
try{
//send lock request thought ghost file name
LOGGER.debug("webdav path: " + path.replace("dav", "webdav") + "/.lock_" + userId); //TODO Retrieve client unique identifier
WebdavFileObject fileObject = (WebdavFileObject) vfsManager.resolveFile(path.replace("dav", "webdav") + "/.lock_" + userId);
fileWriter = fileObject.getOutputStream();
}catch(Exception e){
LOGGER.debug("It's all ok.. sending lock request");
}
allOk = true;
break;
case UNLOCK:
try{
//send unlock request thought ghost file name
LOGGER.debug("webdav path: " + path.replace("dav", "webdav") + "/.unlock_" + userId); //TODO Retrieve client unique identifier
WebdavFileObject fileObject = (WebdavFileObject) vfsManager.resolveFile(path.replace("dav", "webdav") + "/.unlock_" + userId);
fileWriter = fileObject.getOutputStream();
}catch(Exception e){
LOGGER.debug("It's all ok.. sending unlock request");
}
allOk = true;