public class OwMultiPart extends Object
A FilePart is an upload part, which represents an input type = "file" form parameter.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwMultiPart(String name_p,
javax.servlet.ServletInputStream in_p,
String boundary_p,
String contentType_p,
String fileName_p,
String filePath_p)
Construct a file part
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Returns the content type of the file data contained within.
|
String |
getFileName()
Returns the name that the file was stored with on the remote system, or
null if the user didn't enter a file to be uploaded. |
String |
getFilePath()
Returns the full path and name of the file on the remote system, or
null if the user didn't enter a file to be uploaded. |
InputStream |
getInputStream()
Returns an input stream which contains the contents of the file supplied.
|
String |
getName()
Returns the name of the form element that this Part corresponds to.
|
boolean |
isFile()
Returns true if this Part is a FilePart.
|
long |
writeTo(File fileOrDirectory_p,
String fileName_p)
Write this file part to a file or directory.
|
long |
writeTo(OutputStream out_p)
Write this file part to the given output stream.
|
public OwMultiPart(String name_p, javax.servlet.ServletInputStream in_p, String boundary_p, String contentType_p, String fileName_p, String filePath_p) throws IOException
name_p
- String - the name of the parameter.in_p
- ServletInputStream - the servlet input stream to read the file from.boundary_p
- String - the MIME boundary that delimits the end of file.contentType_p
- String - the content type of the file provided in the MIME header.fileName_p
- String - the file system name of the file provided in the MIME header.filePath_p
- String - the file system path of the file provided in the MIME header
(as specified in disposition info).IOException
- if an input or output exception has occurred.public String getName()
public String getFileName()
null
if the user didn't enter a file to be uploaded.null
.public String getFilePath()
null
if the user didn't enter a file to be uploaded.null
.public String getContentType()
public InputStream getInputStream()
0
bytes
in the input stream.public long writeTo(File fileOrDirectory_p, String fileName_p) throws IOException
fileName_p
- name of the uploaded filefileOrDirectory_p
- File/Dir to which data will be writtenIOException
- if an input or output exception is occurred.public long writeTo(OutputStream out_p) throws IOException
out_p
- OutputStream to which data will be writtenIOException
- if an input or output exception is occurred.public boolean isFile()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.