private int analyse(CmsResource res, String sourceMergeFolder, String targetMergefolder, int currentFolder) {

        int retValue = -1;
        String resourcenameOther = getResourceNameInOtherFolder(
            m_cms.getSitePath(res),
            sourceMergeFolder,
            targetMergefolder);
        try {
            CmsResource otherRes = m_cms.readResource(resourcenameOther, CmsResourceFilter.IGNORE_EXPIRATION);
            // there was a resource with the same name in the other merge folder
            // now check if it is already a sibling of the current resource
            if (res.getResourceId().equals(otherRes.getResourceId())) {
                // it is a sibling, so set the action to "sibling already";
                retValue = FOLDERS_SIBLING;
            } else {
                // it is no sibling, now test if it has the same resource type than the oringinal resource
                if (res.getTypeId() == otherRes.getTypeId()) {
                    // both resources have the same type, so set the action to  "same name". Only those resources can be merged
                    retValue = FOLDERS_EQUALNAMES;
                } else {
                    // both resources have different types, so set the action to "different types"
                    retValue = FOLDERS_DIFFERENTTYPES;
                }
            }
        } catch (CmsException e) {
            // the resource was not found, so set the action mode to "found only in the source folder"
            if (currentFolder == 1) {
                retValue = FOLDER1_EXCLUSIVE;
            } else {
                retValue = FOLDER2_EXCLUSIVE;
            }
        }

        return retValue;
    }
private int analyse ( CmsResource res , String sourceMergeFolder , String targetMergefolder , int currentFolder ) { int retValue = - 1 ; String resourcenameOther = getResourceNameInOtherFolder ( m_cms . getSitePath ( res ) , sourceMergeFolder , targetMergefolder ) ; try { CmsResource otherRes = m_cms . readResource ( resourcenameOther , CmsResourceFilter . IGNORE_EXPIRATION ) ; if ( res . getResourceId ( ) . equals ( otherRes . getResourceId ( ) ) ) { retValue = FOLDERS_SIBLING ; } else { if ( res . getTypeId ( ) == otherRes . getTypeId ( ) ) { retValue = FOLDERS_EQUALNAMES ; } else { retValue = FOLDERS_DIFFERENTTYPES ; } } } catch ( CmsException e ) { if ( currentFolder == 1 ) { retValue = FOLDER1_EXCLUSIVE ; } else { retValue = FOLDER2_EXCLUSIVE ; } } return retValue ; }
Analyses a page in the source morge folder and tests if a resouce with the same name exists in the target merge folder.<p>

The method then calcualtes a action for further processing of this page, possible values are:
<ul>
<li>C_FOLDER1_EXCLUSIVE: exclusivly found in folder 1</li>
<li>C_FOLDER2_EXCLUSIVE: exclusivly found in folder 2</li>
<li>C_FOLDERS_SIBLING: found in both folders as siblings of each other </li>
<li>C_FOLDERS_EQUALNAMES: found in both folders as individual resources</li>
<li>C_FOLDERS_DIFFERENTTYPES: found in both folders as different types</li>
</ul>
@param res the resource to test
@param sourceMergeFolder the path to the source merge folder
@param targetMergefolder the path to the target merge folder
@param currentFolder integer value (1 or 2) showing if the source folder is folder 1 or folder 2
@return value of the action to do with this page