SaasposeApp.setAppKey("9a6************************");
SaasposeApp.setAppSID("77**************************");
String strURI = "http:;
String signedURI = Sign(strURI);
InputStream fileStream = new FileInputStream(inputPath);
InputStream htmlOutput = ProcessCommand(signedURI, "PUT", fileStream);
String destination = "c:\\OutputHTML\\";
boolean success = (new File(destination)).mkdir();
if (success) {
getZippedFiles(htmlOutput, destination);
}
public static void getZippedFiles(InputStream zipFile, String destination) {
try {
byte[] buf = new byte[1024];
ZipInputStream zipinputstream = null;
ZipEntry zipentry;
zipinputstream = new ZipInputStream(zipFile);
zipentry = zipinputstream.getNextEntry();
while (zipentry != null) {
String entryName = destination + zipentry.getName();
entryName = entryName.replace('/', File.separatorChar);
entryName = entryName.replace('\\', File.separatorChar);
System.out.println("entryname " + entryName);
int n;
FileOutputStream fileoutputstream;
File newFile = new File(entryName);
if (zipentry.isDirectory()) {
if (!newFile.mkdirs()) {
break;
}
zipentry = zipinputstream.getNextEntry();
continue;
}
fileoutputstream = new FileOutputStream(entryName);
while ((n = zipinputstream.read(buf, 0, 1024)) > -1) {
fileoutputstream.write(buf, 0, n);
}
fileoutputstream.close();
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
}
zipinputstream.close();
} catch (Exception e) {
e.printStackTrace();
}
}