public class DiskFileUploadReceiver extends FileUploadReceiver
Constructor and Description |
---|
DiskFileUploadReceiver() |
Modifier and Type | Method and Description |
---|---|
protected java.io.File |
createContentTypeFile(java.io.File uploadedFile,
FileDetails details)
Creates a file to save the content-type.
|
protected java.io.File |
createTargetFile(FileDetails details)
Creates a file to save the received data to.
|
static java.lang.String |
getContentType(java.io.File uploadedFile)
Obtains the content type provided by the client when the given file was uploaded.
|
java.io.File[] |
getTargetFiles()
Returns an array with files that the received data has been saved to.
|
void |
receive(java.io.InputStream dataStream,
FileDetails details)
Reads and processes all data from the provided input stream.
|
public void receive(java.io.InputStream dataStream, FileDetails details) throws java.io.IOException
FileUploadReceiver
receive
in class FileUploadReceiver
dataStream
- the stream to read fromdetails
- the details of the uploaded file like file name, content-type and sizejava.io.IOException
- if an input / output error occurspublic static java.lang.String getContentType(java.io.File uploadedFile)
uploadedFile
- - the file that was uploaded and handled by an instance of
DiskFileUploadReceiver.null
if the content type could
not be found.public java.io.File[] getTargetFiles()
protected java.io.File createTargetFile(FileDetails details) throws java.io.IOException
details
- the details of the uploaded file like file name, content-type and sizejava.io.IOException
protected java.io.File createContentTypeFile(java.io.File uploadedFile, FileDetails details) throws java.io.IOException
uploadedFile
- the file that contains uploaded datadetails
- the details of the uploaded file like file name, content-type and sizejava.io.IOException
Copyright (c) EclipseSource and others 2002, 2017.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0