*
* @param response the response to manage
* @return the server primitives contained in the .response file
*/
public static ServerPrimitives manageResponse(WebdavFileObject response){
ServerPrimitives returnValue = null;
InputStream is = null;
try {
is = response.getInputStream();
} catch (FileSystemException e1) {
LOGGER.error("While retrieve input stream from webdavfileobject - " + e1.getMessage());
}
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
try {
line = br.readLine();
boolean operationDone = false;
while(line != null) {
LOGGER.debug("Line read: " + line);
for (int i = 0; i < ServerPrimitives.values().length; i++) {
ServerPrimitives primitive = ServerPrimitives.values()[i];
if(line.contains(primitive.toString())) { //primitive found
returnValue = primitive;
operationDone = true;
break;
}
}