mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-25 00:28:20 -05:00
clean up
This commit is contained in:
parent
7b70938394
commit
0a1907564a
1 changed files with 3 additions and 3 deletions
|
@ -119,11 +119,11 @@ public class ScratchJrUtil {
|
||||||
*/
|
*/
|
||||||
public static boolean zipFileAtPath(String sourcePath, String toLocation) {
|
public static boolean zipFileAtPath(String sourcePath, String toLocation) {
|
||||||
File sourceFile = new File(sourcePath);
|
File sourceFile = new File(sourcePath);
|
||||||
if (sourceFile.exists()) {
|
|
||||||
sourceFile.delete();
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
BufferedInputStream origin;
|
BufferedInputStream origin;
|
||||||
|
// we don't need to remove file at `toLocation`
|
||||||
|
// because `FileOutputStream` will overwrite the file
|
||||||
|
// if no `append` parameter is passed
|
||||||
FileOutputStream dest = new FileOutputStream(toLocation);
|
FileOutputStream dest = new FileOutputStream(toLocation);
|
||||||
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
|
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
|
||||||
dest));
|
dest));
|
||||||
|
|
Loading…
Reference in a new issue