public class UploadFileUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_RELATIVE_UPLOAD_FILE_PATH |
Constructor and Description |
---|
UploadFileUtils(IPentahoSession sessionValue) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkExtension(String fileName,
boolean emitMessage) |
boolean |
checkLimits(long itemSize) |
boolean |
checkLimits(long itemSize,
boolean compressed) |
String |
getFileName()
Getters and Setters
|
String |
getPath() |
File |
getPathDir() |
String |
getRelativePath() |
org.apache.commons.fileupload.FileItem |
getUploadedFileItem() |
Writer |
getWriter() |
protected String |
handleGZip(File file,
boolean fullPath) |
protected String |
handleTar(File file) |
protected String |
handleTarGZ(File file) |
protected boolean |
handleUnzip(File file) |
protected String |
handleZip(File file)
Decompress a zip file and return a list of the file names that were unpacked
|
boolean |
isShouldUnzip() |
boolean |
isTemporary() |
boolean |
process() |
boolean |
process(InputStream inputStream)
process uploading using inputStream instead of UploadedFileItem
do not support unzipping
|
void |
setFileName(String value) |
void |
setShouldUnzip(boolean value) |
void |
setTemporary(boolean value) |
void |
setUploadedFileItem(org.apache.commons.fileupload.FileItem value) |
void |
setWriter(Writer value) |
public static final String DEFAULT_RELATIVE_UPLOAD_FILE_PATH
public UploadFileUtils(IPentahoSession sessionValue)
protected boolean checkExtension(String fileName, boolean emitMessage) throws IOException
IOException
public boolean process(InputStream inputStream) throws Exception
inputStream
- Exception
protected boolean handleUnzip(File file) throws IOException
IOException
protected String handleZip(File file) throws IOException
file
- session
- IOException
protected String handleGZip(File file, boolean fullPath) throws IOException
IOException
protected String handleTar(File file) throws IOException
IOException
protected String handleTarGZ(File file) throws IOException
IOException
public boolean checkLimits(long itemSize) throws IOException
IOException
public boolean checkLimits(long itemSize, boolean compressed) throws IOException
IOException
public String getFileName()
public void setFileName(String value)
public boolean isShouldUnzip()
public void setShouldUnzip(boolean value)
public boolean isTemporary()
public void setTemporary(boolean value)
public void setWriter(Writer value)
public Writer getWriter()
public void setUploadedFileItem(org.apache.commons.fileupload.FileItem value)
public org.apache.commons.fileupload.FileItem getUploadedFileItem()
public String getPath()
public File getPathDir()
public String getRelativePath()
Copyright © 2017 Hitachi Vantara. All rights reserved.