private void copy( ITransaction transaction,
                       String sourcePath,
                       String destinationPath,
                       Hashtable<String, Integer> errorList,
                       HttpServletRequest req,
                       HttpServletResponse resp ) throws WebdavException, IOException {

        StoredObject sourceSo = store.getStoredObject(transaction, sourcePath);
        if (sourceSo == null) {
            resp.setStatus(WebdavStatus.SC_NOT_FOUND);
            return;
        }
        if (sourceSo.isResource()) {
            store.createResource(transaction, destinationPath);
            long resourceLength = store.setResourceContent(transaction,
                                                           destinationPath,
                                                           store.getResourceContent(transaction, sourcePath),
                                                           null,
                                                           null);

            if (resourceLength != -1) {
                StoredObject destinationSo = store.getStoredObject(transaction, destinationPath);
                destinationSo.setResourceLength(resourceLength);
            }

        } else {

            if (sourceSo.isFolder()) {
                copyFolder(transaction, sourcePath, destinationPath, errorList, req, resp);
            } else {
                resp.sendError(WebdavStatus.SC_NOT_FOUND);
            }
        }
    }
private void copy ( ITransaction transaction , String sourcePath , String destinationPath , Hashtable < String , Integer > errorList , HttpServletRequest req , HttpServletResponse resp ) throws WebdavException , IOException { StoredObject sourceSo = store . getStoredObject ( transaction , sourcePath ) ; if ( sourceSo == null ) { resp . setStatus ( WebdavStatus . SC_NOT_FOUND ) ; return ; } if ( sourceSo . isResource ( ) ) { store . createResource ( transaction , destinationPath ) ; long resourceLength = store . setResourceContent ( transaction , destinationPath , store . getResourceContent ( transaction , sourcePath ) , null , null ) ; if ( resourceLength != - 1 ) { StoredObject destinationSo = store . getStoredObject ( transaction , destinationPath ) ; destinationSo . setResourceLength ( resourceLength ) ; } } else { if ( sourceSo . isFolder ( ) ) { copyFolder ( transaction , sourcePath , destinationPath , errorList , req , resp ) ; } else { resp . sendError ( WebdavStatus . SC_NOT_FOUND ) ; } } }
copies the specified resource(s) to the specified destination. preconditions must be handled by the caller. Standard status
codes must be handled by the caller. a multi status report in case of errors is created here.

@param transaction indicates that the method is within the scope of a WebDAV transaction
@param sourcePath path from where to read
@param destinationPath path where to write
@param errorList
@param req HttpServletRequest
@param resp HttpServletResponse
@throws WebdavException if an error in the underlying store occurs
@throws IOException