public void addToPollingScheme(String objectName, String pollingScheme) {
        String objectPath;
        Document doc;
        if (browseFolder.isRootFolder()) {
            objectPath = browseFolder.getPath() + objectName;
        } else {
            objectPath = browseFolder.getPath() + "/" + objectName;
        }
        try {
            doc = (Document) session.getObjectByPath(objectPath);
            Folder target;
            try {
                target = (Folder) session.getObjectByPath("/PollingSchemes/"
                        + pollingScheme);

                if (repositoryType == REP_TYPE_ALFRESCO) {
                    doc.addToFolder(target, true);
                } else if (repositoryType == REP_TYPE_NUXEO) {
                    List<Object> newPollingSchemes;
                    Property<Object> pollingSchemes = doc.getProperty("loc:pollingschemes");
                    Map<String, Object> newProps = new HashMap<String, Object>();
                    if (pollingSchemes.isMultiValued()) {
                        newPollingSchemes = (List<Object>) pollingSchemes.getValues();
                        if (!(newPollingSchemes.contains(target.getPath()))) {
                            newPollingSchemes.add(target.getPath());
                        }
                        newProps.put("loc:pollingschemes", newPollingSchemes);
                        doc.updateProperties(newProps, true);
                    }

                }

            } catch (CmisObjectNotFoundException e) {
                System.out.println("Folder not found: " + e.getMessage());
            } catch (ClassCastException e) {
                System.out.println("Object is not a CMIS folder: "
                        + e.getMessage());
            } catch (CmisInvalidArgumentException e) {
                System.out.println("Cannot add to folder: " + e.getMessage());
            }

        } catch (CmisObjectNotFoundException e) {
            System.out.println("Object not found: '" + objectPath + "': "
                    + e.getMessage());
        }
    }