# Path: invenio_files_rest/helpers.py
# def create_file_streaming_redirect_response(obj):
#     """Redirect response generating function."""
#     warnings.warn('This streaming does not support multiple storage backends.')
#     response = make_response()
#     redirect_url_base = '/user_files/'
#     redirect_url_key = urlsplit(obj.file.uri).path
#     response.headers['X-Accel-Redirect'] = redirect_url_base + \
#         redirect_url_key[1:]
#     return response


from datetime import timedelta
from invenio_files_rest.helpers import create_file_streaming_redirect_response
   Factories that reads ``request.stream`` directly must be first in the list,
   otherwise Werkzeug's form-data parser will read the stream.
"""

FILES_REST_MULTIPART_MAX_PARTS = 10000
"""Maximum number of parts when uploading files with multipart uploads."""

FILES_REST_MULTIPART_CHUNKSIZE_MIN = 5 * 1024 * 1024  # 5 MiB
"""Minimum chunk size in bytes of multipart objects."""

FILES_REST_MULTIPART_CHUNKSIZE_MAX = 5 * 1024 * 1024 * 1024  # 5 GiB
"""Maximum chunk size in bytes of multipart objects."""

FILES_REST_MULTIPART_EXPIRES = timedelta(days=4)
"""Time delta after which a multipart upload is considered expired."""

FILES_REST_TASK_WAIT_INTERVAL = 2
"""Interval in seconds between sending a whitespace to not close connection."""

FILES_REST_TASK_WAIT_MAX_SECONDS = 600
"""Maximum number of seconds to wait for a task to finish."""

FILES_REST_FILE_TAGS_HEADER = 'X-Invenio-File-Tags'
"""Header for updating file tags."""

FILES_REST_XSENDFILE_ENABLED = False
"""Use the X-Accel-Redirect header to stream the file through a reverse proxy(
    e.g NGINX)."""

FILES_REST_XSENDFILE_RESPONSE_FUNC =  \

# Path: invenio_files_rest/helpers.py
# def create_file_streaming_redirect_response(obj):
#     """Redirect response generating function."""
#     warnings.warn('This streaming does not support multiple storage backends.')
#     response = make_response()
#     redirect_url_base = '/user_files/'
#     redirect_url_key = urlsplit(obj.file.uri).path
#     response.headers['X-Accel-Redirect'] = redirect_url_base + \
#         redirect_url_key[1:]
#     return response


# Path: invenio_files_rest/config.py
from datetime import timedelta
from invenio_files_rest.helpers import create_file_streaming_redirect_response

   Factories that reads ``request.stream`` directly must be first in the list,
   otherwise Werkzeug's form-data parser will read the stream.
"""

FILES_REST_MULTIPART_MAX_PARTS = 10000
"""Maximum number of parts when uploading files with multipart uploads."""

FILES_REST_MULTIPART_CHUNKSIZE_MIN = 5 * 1024 * 1024  # 5 MiB
"""Minimum chunk size in bytes of multipart objects."""

FILES_REST_MULTIPART_CHUNKSIZE_MAX = 5 * 1024 * 1024 * 1024  # 5 GiB
"""Maximum chunk size in bytes of multipart objects."""

FILES_REST_MULTIPART_EXPIRES = timedelta(days=4)
"""Time delta after which a multipart upload is considered expired."""

FILES_REST_TASK_WAIT_INTERVAL = 2
"""Interval in seconds between sending a whitespace to not close connection."""

FILES_REST_TASK_WAIT_MAX_SECONDS = 600
"""Maximum number of seconds to wait for a task to finish."""

FILES_REST_FILE_TAGS_HEADER = 'X-Invenio-File-Tags'
"""Header for updating file tags."""

FILES_REST_XSENDFILE_ENABLED = False
"""Use the X-Accel-Redirect header to stream the file through a reverse proxy(
    e.g NGINX)."""

FILES_REST_XSENDFILE_RESPONSE_FUNC =  \

    create_file_streaming_redirect_response