private Action getAction(String line) {
    	
    	String[] lineSplitted = line.split(" ");
    	int second = Integer.parseInt(lineSplitted[0]);
    	String filePath = lineSplitted[2];
        
        ActionsName a = ActionsName.valueOf(lineSplitted[ACTION_INDEX]);
        Action action;
        
        switch (a) {
        case ADD:
        	String destPath = lineSplitted[3];
        	action = new Add(second, filePath, destPath);
        	break;
        case REMOVE:
        	action = new Remove(second, filePath);
        	break;
        case UPDATE:
        	
        	ArrayList<ByteRange> ranges = new ArrayList<ByteRange>();
        	
        	for (int i=3; i<lineSplitted.length; i+=2) {
        		int byteStart = Integer.parseInt(lineSplitted[i]);
            	int byteEnd = Integer.parseInt(lineSplitted[i+1]);
        		ByteRange range = new ByteRange(byteStart, byteEnd);
        		ranges.add(range);
        	}
        	
        	action = new Update(second, filePath, ranges);
        	break;
        default:
        	action = null;
        }
        
        return action;
    }