public class TempFilePart extends Object implements IUnbufferedPartFactory
| Modifier and Type | Class and Description |
|---|---|
static class |
TempFilePart.Disposition |
| Constructor and Description |
|---|
TempFilePart() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createDownloadAction(NodeBase sourcePage,
File target,
String mime,
TempFilePart.Disposition disposition,
String name)
Force the browser to download the specified file, by sending "location.href = (url-to-file)" to the browser.
|
void |
generate(DomApplication app,
String rurl,
RequestContextImpl param) |
static String |
getDownloadLink(IRequestContext ctx,
Blob blob,
String mime,
String type,
String filename)
Saves blob into temporary file, register temporary file in provided context, and returns generated download link.
|
static String |
registerTempFile(File target,
String mime,
TempFilePart.Disposition disp,
String name)
Register a temp file that can be accessed by the browser.
|
static String |
registerTempFile(IRequestContext ctx,
File target,
String mime,
String type,
String name)
Deprecated.
|
@Deprecated public static String registerTempFile(@Nonnull IRequestContext ctx, @Nonnull File target, @Nonnull String mime, @Nullable String type, @Nullable String name)
registerTempFile(java.io.File, String, to.etc.domui.parts.TempFilePart.Disposition, String)ctx - target - mime - type - name - public static String registerTempFile(@Nonnull File target, @Nonnull String mime, @Nonnull TempFilePart.Disposition disp, @Nullable String name)
target - mime - disp - The disposition: attachment or inline (download or view)name - public static String getDownloadLink(@Nonnull IRequestContext ctx, @Nonnull Blob blob, String mime, String type, String filename) throws Exception
ctx - blob - mime - type - filename - Exceptionpublic static void createDownloadAction(@Nonnull NodeBase sourcePage, @Nonnull File target, @Nonnull String mime, @Nonnull TempFilePart.Disposition disposition, @Nullable String name)
sourcePage - target - mime - disposition - name - public void generate(@Nonnull DomApplication app, @Nonnull String rurl, @Nonnull RequestContextImpl param) throws Exception
generate in interface IUnbufferedPartFactoryExceptionCopyright © 2017 etc.to. All rights reserved.