@PUT
   @Path("/{repoName}/{repoPath:.*}/")
   public Response put(@PathParam("repoName") String repoName, @PathParam("repoPath") String repoPath,
      @HeaderParam(ExtHttpHeaders.LOCKTOKEN) String lockTokenHeader, @HeaderParam(ExtHttpHeaders.IF) String ifHeader,
      @HeaderParam(ExtHttpHeaders.FILE_NODETYPE) String fileNodeTypeHeader,
      @HeaderParam(ExtHttpHeaders.CONTENT_NODETYPE) String contentNodeTypeHeader,
      @HeaderParam(ExtHttpHeaders.CONTENT_MIXINTYPES) String mixinTypes,
      @HeaderParam(ExtHttpHeaders.CONTENT_TYPE) MediaType mediaType,
      @HeaderParam(ExtHttpHeaders.USER_AGENT) String userAgent, InputStream inputStream, @Context UriInfo uriInfo)
   {
      if (log.isDebugEnabled())
      {
         log.debug("PUT " + repoName + "/" + repoPath);
      }

      repoPath = normalizePath(repoPath);
      MimeTypeRecognizer mimeTypeRecognizer =
         new MimeTypeRecognizer(TextUtil.nameOnly(repoPath), mimeTypeResolver, mediaType, webDavServiceInitParams
            .isUntrustedUserAgent(userAgent));

      try
      {
         repoName = getRepositoryName(repoName);
         List<String> tokens = lockTokens(lockTokenHeader, ifHeader);
         Session session = session(repoName, workspaceName(repoPath), tokens);

         String fileNodeType =
            NodeTypeUtil.getNodeType(fileNodeTypeHeader, webDavServiceInitParams.getDefaultFileNodeType(),
               webDavServiceInitParams.getAllowedFileNodeTypes());

         String contentNodeType = NodeTypeUtil.getContentNodeType(contentNodeTypeHeader);
         NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
         NodeType nodeType = ntm.getNodeType(contentNodeType);
         NodeTypeUtil.checkContentResourceType(nodeType);

         if (webDavServiceInitParams.isEnableAutoVersion())
         {
            return new PutCommand(nullResourceLocks, uriInfo.getBaseUriBuilder().path(getClass()).path(repoName),
               mimeTypeRecognizer).put(session, path(repoPath), inputStream, fileNodeType, contentNodeType,
               NodeTypeUtil.getMixinTypes(mixinTypes), tokens, webDavServiceInitParams.getAllowedAutoVersionPath());
         }
         else
         {

            return new PutCommand(nullResourceLocks, uriInfo.getBaseUriBuilder().path(getClass()).path(repoName),
               mimeTypeRecognizer).put(session, path(repoPath), inputStream, fileNodeType, contentNodeType,
               NodeTypeUtil.getMixinTypes(mixinTypes), webDavServiceInitParams.getDefaultUpdatePolicyType(),
               webDavServiceInitParams.getDefaultAutoVersionType(), tokens);

         }

      }
      catch (NoSuchWorkspaceException exc)
      {
         log.error("NoSuchWorkspaceException " + exc.getMessage(), exc);
         return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage()).build();

      }
      catch (NoSuchNodeTypeException exc)
      {
         log.error("NoSuchNodeTypeException " + exc.getMessage(), exc);
         return Response.status(HTTPStatus.BAD_REQUEST).entity(exc.getMessage()).build();
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
      }
   }
@ PUT @ Path ( "/{repoName}/{repoPath:.*}/" ) public Response put ( @ PathParam ( "repoName" ) String repoName , @ PathParam ( "repoPath" ) String repoPath , @ HeaderParam ( ExtHttpHeaders . LOCKTOKEN ) String lockTokenHeader , @ HeaderParam ( ExtHttpHeaders . IF ) String ifHeader , @ HeaderParam ( ExtHttpHeaders . FILE_NODETYPE ) String fileNodeTypeHeader , @ HeaderParam ( ExtHttpHeaders . CONTENT_NODETYPE ) String contentNodeTypeHeader , @ HeaderParam ( ExtHttpHeaders . CONTENT_MIXINTYPES ) String mixinTypes , @ HeaderParam ( ExtHttpHeaders . CONTENT_TYPE ) MediaType mediaType , @ HeaderParam ( ExtHttpHeaders . USER_AGENT ) String userAgent , InputStream inputStream , @ Context UriInfo uriInfo ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "PUT " + repoName + "/" + repoPath ) ; } repoPath = normalizePath ( repoPath ) ; MimeTypeRecognizer mimeTypeRecognizer = new MimeTypeRecognizer ( TextUtil . nameOnly ( repoPath ) , mimeTypeResolver , mediaType , webDavServiceInitParams . isUntrustedUserAgent ( userAgent ) ) ; try { repoName = getRepositoryName ( repoName ) ; List < String > tokens = lockTokens ( lockTokenHeader , ifHeader ) ; Session session = session ( repoName , workspaceName ( repoPath ) , tokens ) ; String fileNodeType = NodeTypeUtil . getNodeType ( fileNodeTypeHeader , webDavServiceInitParams . getDefaultFileNodeType ( ) , webDavServiceInitParams . getAllowedFileNodeTypes ( ) ) ; String contentNodeType = NodeTypeUtil . getContentNodeType ( contentNodeTypeHeader ) ; NodeTypeManager ntm = session . getWorkspace ( ) . getNodeTypeManager ( ) ; NodeType nodeType = ntm . getNodeType ( contentNodeType ) ; NodeTypeUtil . checkContentResourceType ( nodeType ) ; if ( webDavServiceInitParams . isEnableAutoVersion ( ) ) { return new PutCommand ( nullResourceLocks , uriInfo . getBaseUriBuilder ( ) . path ( getClass ( ) ) . path ( repoName ) , mimeTypeRecognizer ) . put ( session , path ( repoPath ) , inputStream , fileNodeType , contentNodeType , NodeTypeUtil . getMixinTypes ( mixinTypes ) , tokens , webDavServiceInitParams . getAllowedAutoVersionPath ( ) ) ; } else { return new PutCommand ( nullResourceLocks , uriInfo . getBaseUriBuilder ( ) . path ( getClass ( ) ) . path ( repoName ) , mimeTypeRecognizer ) . put ( session , path ( repoPath ) , inputStream , fileNodeType , contentNodeType , NodeTypeUtil . getMixinTypes ( mixinTypes ) , webDavServiceInitParams . getDefaultUpdatePolicyType ( ) , webDavServiceInitParams . getDefaultAutoVersionType ( ) , tokens ) ; } } catch ( NoSuchWorkspaceException exc ) { log . error ( "NoSuchWorkspaceException " + exc . getMessage ( ) , exc ) ; return Response . status ( HTTPStatus . CONFLICT ) . entity ( exc . getMessage ( ) ) . build ( ) ; } catch ( NoSuchNodeTypeException exc ) { log . error ( "NoSuchNodeTypeException " + exc . getMessage ( ) , exc ) ; return Response . status ( HTTPStatus . BAD_REQUEST ) . entity ( exc . getMessage ( ) ) . build ( ) ; } catch ( Exception exc ) { log . error ( exc . getMessage ( ) , exc ) ; return Response . serverError ( ) . entity ( exc . getMessage ( ) ) . build ( ) ; } }
WedDAV "PUT" method. See <a
href='http://www.ietf.org/rfc/rfc2518.txt'>HTTP methods for distributed
authoring sec. 8.7 "PUT"</a>.

@param repoName repository name
@param repoPath path in repository
@param lockTokenHeader Lock-Token HTTP header
@param ifHeader If HTTP Header
@param fileNodeTypeHeader JCR NodeType header
@param contentNodeTypeHeader JCR Content-NodeType header
@param mixinTypes JCR Mixin types header
@param mediaType Content-Type HTTP header
@param userAgent User-Agent HTTP header
@param inputStream stream that contain incoming data
@param uriInfo URI info
@return the instance of javax.ws.rs.core.Response
@LevelAPI Platform