public CmsUploadFileBean checkUploadFiles(List<String> fileNames, String targetFolder, boolean isRootPath) {

        List<String> existingResourceNames = new ArrayList<String>();
        List<String> invalidFileNames = new ArrayList<String>();
        List<String> existingDeleted = new ArrayList<String>();
        boolean isActive = false;

        // check if there is an active upload
        if (getRequest().getSession().getAttribute(CmsUploadBean.SESSION_ATTRIBUTE_LISTENER_ID) == null) {

            // check for existing files
            for (String fileName : fileNames) {

                try {
                    Streams.checkFileName(fileName);
                    String newResName = CmsUploadBean.getNewResourceName(getCmsObject(), fileName, targetFolder);
                    if (existsResource(newResName, isRootPath)) {
                        if (isDeletedResource(newResName, isRootPath)) {
                            existingDeleted.add(fileName);
                        } else {
                            existingResourceNames.add(fileName);
                        }
                    }
                } catch (InvalidFileNameException e) {
                    invalidFileNames.add(fileName);
                }
            }
        } else {
            isActive = true;
        }
        return new CmsUploadFileBean(existingResourceNames, invalidFileNames, existingDeleted, isActive);
    }
public CmsUploadFileBean checkUploadFiles ( List < String > fileNames , String targetFolder , boolean isRootPath ) { List < String > existingResourceNames = new ArrayList < String > ( ) ; List < String > invalidFileNames = new ArrayList < String > ( ) ; List < String > existingDeleted = new ArrayList < String > ( ) ; boolean isActive = false ; if ( getRequest ( ) . getSession ( ) . getAttribute ( CmsUploadBean . SESSION_ATTRIBUTE_LISTENER_ID ) == null ) { for ( String fileName : fileNames ) { try { Streams . checkFileName ( fileName ) ; String newResName = CmsUploadBean . getNewResourceName ( getCmsObject ( ) , fileName , targetFolder ) ; if ( existsResource ( newResName , isRootPath ) ) { if ( isDeletedResource ( newResName , isRootPath ) ) { existingDeleted . add ( fileName ) ; } else { existingResourceNames . add ( fileName ) ; } } } catch ( InvalidFileNameException e ) { invalidFileNames . add ( fileName ) ; } } } else { isActive = true ; } return new CmsUploadFileBean ( existingResourceNames , invalidFileNames , existingDeleted , isActive ) ; }
@see org.opencms.gwt.shared.rpc.I_CmsUploadService#checkUploadFiles(java.util.List, java.lang.String, boolean)