Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.7.x] Allow to set inline content-disposition AND filename together #9044

Merged
merged 4 commits into from Feb 19, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

status(...) methods that take both inline AND filename

  • Loading branch information...
mkurz committed Feb 18, 2019
commit d7316e0716ce22dc44154bdaa3ea89110ea432aa
@@ -240,6 +240,35 @@ public static Result status(
return status(status).sendFile(content, fileName, fileMimeTypes);
}

/**
* Generates a result.
*
* @param status the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)
* @param content the file to send
* @param inline <code>true</code> to have it sent with inline Content-Disposition.
* @param fileName the name that the client should receive this file as
* @return the result
*/
public static Result status(
int status, File content, boolean inline, String fileName) {
return status(status).sendFile(content, inline, fileName);
}

/**
* Generates a result.
*
* @param status the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)
* @param content the file to send
* @param inline <code>true</code> to have it sent with inline Content-Disposition.
* @param fileName the name that the client should receive this file as
* @param fileMimeTypes Used for file type mapping.
* @return the result
*/
public static Result status(
int status, File content, boolean inline, String fileName, FileMimeTypes fileMimeTypes) {
return status(status).sendFile(content, inline, fileName, fileMimeTypes);
}

/**
* Generates a 204 No Content result.
*
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.