Interface PutableResource

    • Method Detail

      • createNew

        Resource createNew​(String newName,
                           InputStream inputStream,
                           Long length,
                           String contentType)
                    throws IOException,
                           io.milton.http.exceptions.ConflictException,
                           io.milton.http.exceptions.NotAuthorizedException,
                           io.milton.http.exceptions.BadRequestException
        Create a new resource, or overwrite an existing one
        Parameters:
        newName - - the name to create within the collection. E.g. myFile.txt
        inputStream - - the data to populate the resource with
        length - - the length of the data
        contentType - - the content type of the data being uploaded. This can be a list, such as "image/pjpeg,image/jpeg". It is the responsibility of the application to create a resource which also represents those content types, or a subset
        Returns:
        - a reference to the new resource
        Throws:
        IOException
        io.milton.http.exceptions.ConflictException
        io.milton.http.exceptions.NotAuthorizedException
        io.milton.http.exceptions.BadRequestException