/**
* 此方法是用来进行压缩包文件解压缩使用
* @param inFile
* @param outFile
* @return
*/
private boolean uncoilZIP(File inFile,File outFile){
if(!inFile.exists()){
logger.info("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常,未发现上传压缩包");
return false;
}
GZIPInputStream input = null;
OutputStream output = null;
try {
if(!outFile.exists()){
if(!outFile.createNewFile()){
logger.info("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常,解压缩后的文件目录不存在!");
return false;
}
}
input = new GZIPInputStream(new FileInputStream(inFile));
output = new FileOutputStream(outFile);
byte block[] = new byte[1024];
int length = 0;
while((length = input.read(block))!=-1){
output.write(block,0,length);
}
output.flush();
return true;
} catch (IOException e) {
logger.error("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常"+e.getMessage());
return false;
}finally{
try {
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
} catch (IOException e) {
logger.error("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类关闭文件流出错"+e.getMessage());
}
}
}
* 此方法是用来进行压缩包文件解压缩使用
* @param inFile
* @param outFile
* @return
*/
private boolean uncoilZIP(File inFile,File outFile){
if(!inFile.exists()){
logger.info("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常,未发现上传压缩包");
return false;
}
GZIPInputStream input = null;
OutputStream output = null;
try {
if(!outFile.exists()){
if(!outFile.createNewFile()){
logger.info("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常,解压缩后的文件目录不存在!");
return false;
}
}
input = new GZIPInputStream(new FileInputStream(inFile));
output = new FileOutputStream(outFile);
byte block[] = new byte[1024];
int length = 0;
while((length = input.read(block))!=-1){
output.write(block,0,length);
}
output.flush();
return true;
} catch (IOException e) {
logger.error("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类抛出异常"+e.getMessage());
return false;
}finally{
try {
if(input!=null){
input.close();
}
if(output!=null){
output.close();
}
} catch (IOException e) {
logger.error("添加皮肤com.yc.eap.plugin.base.skin.action.SkinTnsert类关闭文件流出错"+e.getMessage());
}
}
}