insertFile added to ZipFileManipulator
This commit is contained in:
parent
4747d5924f
commit
1c669cde80
|
|
@ -36,4 +36,18 @@ public class ZipFileManipulator {
|
|||
Files.copy(source, outputLocation.toPath());
|
||||
}
|
||||
|
||||
public void insertFile(String targetFile) throws Exception {
|
||||
Path myFilePath = Paths.get(targetFile);
|
||||
|
||||
Path zipFilePath = Paths.get(this.fileName);
|
||||
try( FileSystem fs = FileSystems.newFileSystem(zipFilePath, null) ){
|
||||
Path fileInsideZipPath = fs.getPath("/ppt/" + targetFile);
|
||||
Files.delete(fileInsideZipPath);
|
||||
Files.copy(myFilePath, fileInsideZipPath);
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue